Exemplo n.º 1
0
 /**
  * @param AppModel $model
  * @param int $per_page
  * @param array $filters
  * @param array $columns
  * @return array
  */
 public function paginate(AppModel $model, $per_page = 15, array $filters = [], array $columns = ['*'])
 {
     $this->model = $this->onlyTrashed($model->newQuery());
     $this->model = $this->relation->apply($this->model, $this);
     if ($this instanceof IPaginateRepository) {
         $this->model = $this->filter->apply($this->model, $this, $filters);
     }
     return $this->model->order()->paginate($per_page, $columns)->toArray();
 }