/**
  * Constructor.
  * @param CDataProvider $dataProvider the data provider to iterate over
  * @param integer       $pageSize     pageSize to use for iteration. This is the number of objects loaded into memory at the same time.
  */
 public function __construct(CDataProvider $dataProvider, $pageSize = null)
 {
     $this->_dataProvider = $dataProvider;
     $this->_totalItemCount = $dataProvider->getTotalItemCount();
     if (($pagination = $this->_dataProvider->getPagination()) === false) {
         $this->_dataProvider->setPagination($pagination = new CPagination());
     }
     if ($pageSize !== null) {
         $pagination->setPageSize($pageSize);
     }
 }
Ejemplo n.º 2
0
 public function getTotalItemCount()
 {
     return $this->_dataProvider->getTotalItemCount();
 }