adt / query-utils
Doctrine query helpers for ADT.
Installs: 21 826
Dependents: 0
Suggesters: 0
Security: 0
Stars: 1
Watchers: 5
Forks: 0
Open Issues: 1
Requires
README
Set of Doctrine ORM query helpers.
Prepared Queries
All predefined queries share common ancestor: Query\BaseQuery
.
This class exposes these public methods:
bindExprTo($qb)
- binds generated expression to your QueryBuilder,bindParametersTo($qb)
- binds generated parameters to your QueryBuilder,bindTo($qb)
- binds expression and parameters to your QueryBuilder.
Also, bindExprTo
and bindTo
have second, optional parameter $method
which defaults to and
.
This represents method used for binding.
- if
and
is passed,$qb->andWhere(...)
is used, - if
or
is passed,$qb->orWhere(...)
is used.
Full-text Query
For string $q
to lookup on columns client.firstName
and client.lastName
use following:
long form:
$helper = new \ADT\QueryUtils\Query\FullTextQuery($q, [ 'client.firstName', 'client.lastName' ]); $helper->bindTo($queryBuilder);
or short form:
\ADT\QueryUtils\Query\FullTextQuery::create($q, [ 'client.firstName', 'client.lastName' ])->bindTo($queryBuilder);