Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $qb = $this->createQueryBuilder('u');
- $qb->select(array('u,c'))
- ->innerJoin('u.Entities\Client','c');
- if (!preg_match('/^\d+$/', $client_id)){
- $qb->where($qb->expr()->like('u.client_id',':client_id'));
- $client_id = '%'.$client_id.'%';
- } else {
- $qb->where('u.client_id = :client_id');
- }
- $qb->andWhere('u.username = :username')
- ->andWhere('u.password = :password')
- ->setParameters(
- array(
- 'client_id' => $client_id,
- 'username' => $username,
- 'password' => $password
- )
- );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement