$page
$page : integer
Page
Paginator
In theory, makes paginating large data sets easier. In theory.
$paginator = new Ceo\Core\ModelHelpers\Paginator(1,2) ->from('Ceo\Core\Models\Foo') ->orderBy('created_at desc') ->where('name = :name:', ['name' => $name]) ->andWhere('type = :type:', ['type' => $type]) ->paginate(); echo json_encode($items);
setFilter(callback $filter) : self
Set the result filter
The filter will be passed the individual result model:
$paginator = new Ceo\Core\ModelHelpers\Paginator(1,2) ->from('Ceo\Core\Models\Foo') ->orderBy('created_at desc') ->where('name = :name:', array('name' => $name)) ->andWhere('type = :type:', array('type' => $type)) ->setFilter(function($model) { return $model->toArray(); }) ->paginate();
callback | $filter |