コード例 #1
0
 /**
  * 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();
 }
コード例 #2
0
ファイル: json.php プロジェクト: raeldc/com_learn
    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;
    }
コード例 #3
0
ファイル: table.php プロジェクト: janssit/www.reliancelaw.be
 /**
  * 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();
 }