Builder
class Builder extends Plugin
Builder
Extends QueryBuilder to add findBy options and includes the base Paginator helpers.
Methods
__construct($parentClass)
No description
isPublished()
No description
wherePublished()
No description
withTags($tags = [], $mode = 'AND')
No description
byTags($tags = [], $mode = 'AND')
No description
byAuthors($authors = [], $mode = 'AND')
No description
find()
No description
setBuilder(QueryBuilder $builder)
Reset the query builder
Object
getPagination()
Return the paginator object
Object
getItems()
Return the fetched items
Details
at line 57
__construct($parentClass)
at line 63
isPublished()
at line 67
wherePublished()
at line 72
withTags($tags = [], $mode = 'AND')
at line 77
byTags($tags = [], $mode = 'AND')
at line 147
byAuthors($authors = [], $mode = 'AND')
at line 177
find()
at line 187
Builder
setPage(int $page)
Set the page number
at line 198
Builder
setLimit(int $limit)
Set return limit
at line 210
Builder
setBuilder(QueryBuilder $builder)
Reset the query builder
at line 236
Builder
setFilter(callback $filter)
Set the result filter
The filter will be passed the individual result model:
$paginator = new Ceo\Helpers\Paginator(1,2) ->from('Ceo\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();
at line 249
Builder
paginate(array $return = [])
Paginate results.
at line 298
Object
getPagination()
Return the paginator object
at line 307
Object
getItems()
Return the fetched items
at line 320
Builder
__call(string $f, array $args)
Forward fluent calls for the querybuilder to the actual querybuilder