protected function enabled(QueryBuilder $qb, $enabled = true) { $qb->andwhere('securityUser.enabled = :enabled')->setParameter('enabled', $enabled); return $qb; }
protected function state(QueryBuilder $qb, $states = array()) { $i = 0; $cond = ''; foreach ($states as $state) { if ($i != 0) { $cond .= ' OR '; } $i++; $cond .= 'account.state = :state' . $i; $qb->setParameter('state' . $i, $state); } $qb->andwhere($cond); return $qb; }