/**
  * @param string $url
  * @param int $page
  * @param int $size
  * @return \WoohooLabs\Yin\JsonApi\Schema\Link|null
  */
 protected function createPaginatedLink($url, $page, $size)
 {
     if ($this->getTotalItems() <= 0 || $this->getLimit() <= 0) {
         return null;
     }
     return new Link($this->appendQueryStringToUrl($url, OffsetBasedPagination::getPaginationQueryString($page, $size)));
 }
Beispiel #2
0
 /**
  * @param mixed $defaultOffset
  * @param mixed $defaultLimit
  * @return \WoohooLabs\Yin\JsonApi\Request\Pagination\OffsetBasedPagination
  */
 public function getOffsetBasedPagination($defaultOffset = null, $defaultLimit = null)
 {
     return OffsetBasedPagination::fromPaginationQueryParams($this->getPagination(), $defaultOffset, $defaultLimit);
 }