55 $this->
add($ele, $condition);
69 $this->criteriaElements[] = $criteriaElement;
70 $this->conditions[] = $condition;
82 foreach ($this->criteriaElements as
$i => $element) {
83 if (!is_object($element)) {
88 $ret = $element->render();
90 if (!$render = $element->render()) {
93 $ret .=
' ' . $this->conditions[
$i] .
' (' . $render .
')';
97 $ret = ($ret==
'()') ?
'(1)' : $ret;
109 $ret = ($ret !=
'') ?
'WHERE ' . $ret : $ret;
122 foreach ($this->criteriaElements as
$i => $element) {
125 $ret = $element->renderLdap();
127 $cond = strtoupper($this->conditions[
$i]);
128 $op = ($cond ==
"OR") ?
"|" :
"&";
129 $ret =
"({$op}{$ret}" . $element->renderLdap() .
")";
152 foreach ($this->criteriaElements as
$i => $element) {
153 $expr_part = $element->buildExpressionQb($qb);
154 if ($expr_part !==
false) {
158 $expr .=
' ' . strtoupper($this->conditions[
$i]) .
' ' . $expr_part;
164 $expr =
'(' . $expr .
')';
166 switch (strtolower($whereMode)) {
168 $qb->andWhere($expr);
179 if ($this->limit!=0 || $this->start!=0) {
180 $qb->setFirstResult($this->start)
181 ->setMaxResults($this->limit);
184 if (!empty($this->groupby)) {
185 $qb->groupBy($this->groupby);
188 if (!empty($this->sort)) {
189 $qb->orderBy($this->sort, $this->order);
209 foreach ($this->criteriaElements as
$i => $element) {
210 $expr_part = $element->buildExpressionQb($qb);
211 if ($expr_part !==
false) {
215 $expr .=
' ' . strtoupper($this->conditions[
$i]) .
' ' . $expr_part;
221 $expr =
'(' . $expr .
')';
__construct(CriteriaElement $ele=null, $condition= 'AND')
renderQb(QueryBuilder $qb=null, $whereMode= '')
add(CriteriaElement $criteriaElement, $condition= 'AND')
buildExpressionQb(QueryBuilder $qb)