S
S
snezhanan2015-12-08 20:52:36
symfony
snezhanan, 2015-12-08 20:52:36

Complex logical operator where Sympfony Sonata?

I configure createQuery I form a query string in a loop in order to execute

$qb->where('u.firstName = ?1 AND u.surname = ?2')

why if in line 1 element the request is triggered, and if there are more than 2 elements, then nothing is displayed at all?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dmitry Vapelnik, 2015-12-08
@dvapelnik

in the case of complex use , you WHEREshould write something like

$qb
    ->where('u.firstName = :fitst_name')
    ->andWhere('u.surname = :user_name')
    ->setParameters(array('fitst_name' => 'FirstName', 'user_name' => 'UserName'))

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question