Esempio n. 1
0
 /**
  * Perform pagination, -1 length indicate no limit
  * @param  integer $start
  * @param  integer $length
  * @return self
  */
 public function dtPaginate($start, $length)
 {
     // Never trust client side
     if ($this->maxLimit != -1) {
         if ($length == -1) {
             $length = $this->maxLimit;
         }
         $length = min($length, $this->maxLimit);
     }
     if ($length == -1) {
         $this->dtModel = $this->dtModel->skip($start);
     } else {
         $this->dtModel = $this->dtModel->skip($start)->take($length);
     }
     return $this;
 }
Esempio n. 2
0
 /**
  * Datatables paging
  *
  * @return null
  */
 private function doPaging()
 {
     if (!is_null($this->input['start']) && !is_null($this->input['length']) && $this->input['length'] != -1) {
         $this->query->skip($this->input['start'])->take((int) $this->input['length'] > 0 ? $this->input['length'] : 10);
     }
 }