Set of Doctrine ORM query helpers.
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.
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);