Fixing error with from() parameters in example
The from method requires $from and the $alias to be separate parameters. public function from($from, $alias, $indexBy = null); The examples show: from('User u')
This commit is contained in:
parent
3ca0dae606
commit
abe97bf0df
@ -216,7 +216,7 @@ allowed. Binding parameters can simply be achieved as follows:
|
|||||||
// $qb instanceof QueryBuilder
|
// $qb instanceof QueryBuilder
|
||||||
|
|
||||||
$qb->select('u')
|
$qb->select('u')
|
||||||
->from('User u')
|
->from('User', 'u')
|
||||||
->where('u.id = ?1')
|
->where('u.id = ?1')
|
||||||
->orderBy('u.name', 'ASC')
|
->orderBy('u.name', 'ASC')
|
||||||
->setParameter(1, 100); // Sets ?1 to 100, and thus we will fetch a user with u.id = 100
|
->setParameter(1, 100); // Sets ?1 to 100, and thus we will fetch a user with u.id = 100
|
||||||
@ -230,7 +230,7 @@ alternative syntax is available:
|
|||||||
// $qb instanceof QueryBuilder
|
// $qb instanceof QueryBuilder
|
||||||
|
|
||||||
$qb->select('u')
|
$qb->select('u')
|
||||||
->from('User u')
|
->from('User', 'u')
|
||||||
->where('u.id = :identifier')
|
->where('u.id = :identifier')
|
||||||
->orderBy('u.name', 'ASC')
|
->orderBy('u.name', 'ASC')
|
||||||
->setParameter('identifier', 100); // Sets :identifier to 100, and thus we will fetch a user with u.id = 100
|
->setParameter('identifier', 100); // Sets :identifier to 100, and thus we will fetch a user with u.id = 100
|
||||||
|
Loading…
x
Reference in New Issue
Block a user