/**
  * Return the amount of total items (filtering may be used in the config).
  *
  * @param InterfaceGeneralDataConfig $objConfig
  *
  * @return int
  */
 public function getCount(InterfaceGeneralDataConfig $objConfig)
 {
     $objFilter = $this->prepareFilter($objConfig->getFilter());
     return $this->objMetaModel->getCount($objFilter);
 }
Exemplo n.º 2
0
 /**
  * Prepare the rendering
  */
 public function prepare()
 {
     if ($this->objItems) {
         return $this;
     }
     // create an empty filter object if not done before
     if (!$this->objFilter) {
         $this->objFilter = $this->objMetaModel->getEmptyFilter();
     }
     if ($this->objFilterSettings) {
         $this->objFilterSettings->addRules($this->objFilter, $this->arrParam);
     }
     $this->modifyFilter();
     $intTotal = $this->objMetaModel->getCount($this->objFilter);
     $this->calculatePagination($intTotal);
     $this->objItems = $this->objMetaModel->findByFilter($this->objFilter, $this->strSortBy, $this->intOffset, $this->intLimit, $this->strSortDirection, $this->getAttributeNames());
     return $this;
 }