/**
  * @param null|int $limit
  * @param null|false|int $offsetId
  * @return array
  */
 public function getParameters($limit = null, $offsetId = null)
 {
     $parameters = parent::getParameters($limit);
     $params = [];
     if ($this->sortByParamName) {
         $params[$this->sortByParamName] = $this->sortBy;
     }
     if ($this->sortDirParamName) {
         $params[$this->sortDirParamName] = $this->sortDir;
     }
     if ($this->getLimitParameterName()) {
         $params[$this->getLimitParameterName()] = $limit ? $limit : $this->getLimit();
     }
     if ($offsetId === null && $this->lastId !== null) {
         $offsetId = $this->lastId;
     }
     if ($this->lastIdParamName && $offsetId !== null) {
         $params[$this->lastIdParamName] = $offsetId;
     }
     foreach ($parameters as $name => $param) {
         $params[$name] = $param;
     }
     return $params;
 }
 /**
  * @param  null  $page
  * @param  null  $limit
  * @return array
  */
 public function getParameters($page = null, $limit = null)
 {
     $parameters = parent::getParameters($limit);
     unset($parameters[$this->pageParameterName]);
     $parameters[$this->pageParameterName] = null === $page ? $this->getPage() : $page;
     $this->moveParameterToEnd($parameters, $this->getLimitParameterName());
     return $parameters;
 }
Example #3
0
 /**
  * @param  null  $offset
  * @param  null  $limit
  * @return array
  */
 public function getParameters($offset = null, $limit = null)
 {
     $parameters = parent::getParameters($limit);
     unset($parameters[$this->offsetParameterName]);
     if (null === $offset) {
         $offset = $this->getOffset();
     }
     if ($offset) {
         $parameters[$this->offsetParameterName] = $offset;
         $this->moveParameterToEnd($parameters, $this->getLimitParameterName());
     }
     return $parameters;
 }