From abe97bf0df7391776023145acce23042cd3d5f31 Mon Sep 17 00:00:00 2001 From: Jeremy Postlethwaite Date: Mon, 13 Oct 2014 20:37:19 -0700 Subject: [PATCH] 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') --- docs/en/reference/query-builder.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/en/reference/query-builder.rst b/docs/en/reference/query-builder.rst index ee0e6e4d7..1c9c2a67d 100644 --- a/docs/en/reference/query-builder.rst +++ b/docs/en/reference/query-builder.rst @@ -216,7 +216,7 @@ allowed. Binding parameters can simply be achieved as follows: // $qb instanceof QueryBuilder $qb->select('u') - ->from('User u') + ->from('User', 'u') ->where('u.id = ?1') ->orderBy('u.name', 'ASC') ->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->select('u') - ->from('User u') + ->from('User', 'u') ->where('u.id = :identifier') ->orderBy('u.name', 'ASC') ->setParameter('identifier', 100); // Sets :identifier to 100, and thus we will fetch a user with u.id = 100