1
0
mirror of synced 2025-03-23 00:13:50 +03:00

Update query-builder.rst

->andWhere() can be used directly, without any ->where() before, and we can just always use ->andWhere(). This is why ->hasWhere() is useless, cf. #1043.
This commit is contained in:
Ronan Guilloux 2014-05-29 16:29:49 +02:00
parent 5ee286e7e0
commit 495fe6002d

View File

@ -156,6 +156,8 @@ Here is a complete list of helper methods available in ``QueryBuilder``:
// Example - $qb->where('u.firstName = ?1 AND u.surname = ?2')
public function where($where);
// NOTE: ->andWhere() can be used directly, without any ->where() before
//
// Example - $qb->andWhere($qb->expr()->orX($qb->expr()->lte('u.age', 40), 'u.numChild = 0'))
public function andWhere($where);
@ -518,7 +520,7 @@ of DQL. It takes 3 parameters: ``$dqlPartName``, ``$dqlPart`` and
// "SELECT u FROM User u WHERE u.id = ? ORDER BY u.name ASC"
// using QueryBuilder string support
$qb->add('select', 'u')
->add('from', 'User u')
->add('from', 'UserH u')
->add('where', 'u.id = ?1')
->add('orderBy', 'u.name ASC');