/** * @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, OffsetPagination::getPaginationQueryString($page, $size))); }
/** * @param mixed $defaultOffset * @param mixed $defaultLimit * @return \WoohooLabs\Yin\JsonApi\Request\Pagination\OffsetPagination */ public function getOffsetBasedPagination($defaultOffset = null, $defaultLimit = null) { return OffsetPagination::fromPaginationQueryParams($this->getPagination(), $defaultLimit, $defaultOffset); }