/**
  * @param string $url
  * @param mixed $cursor
  * @return \WoohooLabs\Yin\JsonApi\Schema\Link|null
  */
 protected function createPaginatedLink($url, $cursor)
 {
     if ($cursor === null) {
         return null;
     }
     return new Link($this->appendQueryStringToUrl($url, CursorBasedPagination::getPaginationQueryString($cursor)));
 }
Example #2
0
 /**
  * @param mixed $defaultCursor
  * @return \WoohooLabs\Yin\JsonApi\Request\Pagination\CursorBasedPagination
  */
 public function getCursorBasedPagination($defaultCursor = null)
 {
     return CursorBasedPagination::fromPaginationQueryParams($this->getPagination(), $defaultCursor);
 }