You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Can you change all private functions to protected. A have written "class MySqlDatatables extends Datatables" that optimizes count of result rows. In this class I override methods query and execute.
class MySqlDatatables extends Datatables {
public function query($query)
{
$this->columns = $this->setcolumns($query);
$columns = implode(", ", $this->columns);
$query = rtrim($query, "; ");
$this->sql = "Select SQL_CALC_FOUND_ROWS $columns from ($query)t";
return $this;
}
protected function execute()
{
$this->recordstotal = $this->db->count($this->sql); // unfiltered data count is here.
$where = $this->filter();
$this->data = $this->db->query($this->sql . $where . $this->orderby() . $this->limit());
$rowCounts = $this->db->query("SELECT FOUND_ROWS() as rowCount"); // filtered data count is here.
$this->recordsfiltered = $rowCounts[0]['rowCount'];
$this->query = $this->sql . $where . $this->orderby() . $this->limit();
return $this;
}
}
The text was updated successfully, but these errors were encountered:
Can you change all private functions to protected. A have written "class MySqlDatatables extends Datatables" that optimizes count of result rows. In this class I override methods query and execute.
class MySqlDatatables extends Datatables {
}
The text was updated successfully, but these errors were encountered: