Пример #1
0
 /**
  * When creating a Pagination object, you should provide all pagination data.
  * It's not possible to adjust it afterwards, because of security reasons.
  * 
  * @return void
  */
 public function testInstantiatingSetsCountLimitAndOffset()
 {
     $pagination = new Pagination(30, 50, 0);
     $this->assertEquals(30, $pagination->getCount());
     $this->assertEquals(50, $pagination->getLimit());
     $this->assertEquals(0, $pagination->getOffset());
 }
Пример #2
0
 /**
  * Get the meta structure for pagination descriptions.
  * 
  * @param  Pagination  $pagination
  * @return array
  */
 protected function getPagination(Pagination $pagination)
 {
     return ['count' => $pagination->getCount(), 'offset' => $pagination->getOffset(), 'limit' => $pagination->getLimit()];
 }