/** * Get a list of items which represnts a table rowset * * @return KDatabaseRowset */ public function getTotal() { // Get the data if it doesn't already exist if (!isset($this->_total)) { //$table = $this->getTable(); //$query = $this->_buildQuery(); $this->_total = count($this->_fetchItems()); } return parent::getTotal(); }
protected function _getList(KModelAbstract $model) { $list = array_values($model->getList()->toArray()); $state = $model->getState(); $total = $model->getTotal(); $output = new stdclass; $output->total = $total; $output->limit = $state->limit; $output->offset = $state->offset; $output->items = $list; return $output; }
/** * Get the total amount of items * * @return int */ public function getTotal() { // Get the data if it doesn't already exist if (!isset($this->_total)) { $query = $this->_buildCountQuery(); $this->_db->select($query); $this->_total = $this->_db->loadResult(); } return parent::getTotal(); }