getItemsPerPage() public method

Get requested number items per page
public getItemsPerPage ( ) : integer
return integer Number items per page.
 /**
  * Paginate data
  *
  * @param mixed $data   Data to paginate
  * @param array $params Parameters for Paginator
  *
  * @return array         Paginated data
  */
 public function paginate($data, $params = array())
 {
     $paginator = $this->paginator->paginate($data, $this->pagination->getPage(), $this->pagination->getItemsPerPage(), $params);
     $items['items'] = $paginator->getItems();
     /**
      * Set pagination object only when need
      */
     if ($this->paginationData['itemsPerPage'] < $this->paginationData['itemsCount']) {
         $items['pagination'] = $this->paginationData;
     }
     return $items;
 }
Example #2
0
 /**
  * Paginate data
  * @param  mixed $data   Data to paginate
  * @param  array  $params Prameters for Paginator
  * @return array         Paginated data
  */
 public function paginate($data, $params = array())
 {
     $paginator = $this->paginator->paginate($data, $this->pagination->getPage(), $this->pagination->getItemsPerPage(), $params);
     $items['items'] = $paginator->getItems();
     if (count($items['items']) == 0) {
         throw new NotFoundHttpException('Results was not found.');
     }
     /**
      * Set pagination object only when need
      */
     if ($this->paginationData['itemsPerPage'] < $this->paginationData['itemsCount']) {
         $items['pagination'] = $this->paginationData;
     }
     return $items;
 }