Skip to content
This repository

DDC-1069 #20

Closed
wants to merge 1 commit into from

2 participants

Michael Ridgway Benjamin Eberlei
Michael Ridgway

Removed the ':' in parameter names in the setParameter calls.

Benjamin Eberlei
Owner

Merged

Benjamin Eberlei beberlei closed this March 28, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Showing 1 unique commit by 1 author.

Mar 14, 2011
Removed : from parameter names in setParameter examples 104b0dc
This page is out of date. Refresh to see the latest.
10  en/reference/dql-doctrine-query-language.rst
Source Rendered
@@ -268,7 +268,7 @@ With WHERE Clause and Named Parameter:
268 268
 
269 269
     <?php
270 270
     $query = $em->createQuery('SELECT u FROM ForumUser u WHERE u.username = :name');
271  
-    $query->setParameter(':name', 'Bob');
  271
+    $query->setParameter('name', 'Bob');
272 272
     $users = $query->getResult(); // array of ForumUser objects
273 273
 
274 274
 With Nested Conditions in WHERE Clause:
@@ -278,9 +278,9 @@ With Nested Conditions in WHERE Clause:
278 278
     <?php
279 279
     $query = $em->createQuery('SELECT u from ForumUser u WHERE (u.username = :name OR u.username = :name2) AND u.id = :id');
280 280
     $query->setParameters(array(
281  
-        ':name' => 'Bob',
282  
-        ':name2' => 'Alice',
283  
-        ':id' => 321,
  281
+        'name' => 'Bob',
  282
+        'name2' => 'Alice',
  283
+        'id' => 321,
284 284
     ));
285 285
     $users = $query->getResult(); // array of ForumUser objects
286 286
 
@@ -384,7 +384,7 @@ Get all users who are members of $group.
384 384
 
385 385
     <?php
386 386
     $query = $em->createQuery('SELECT u.id FROM CmsUser u WHERE :groupId MEMBER OF u.groups');
387  
-    $query->setParameter(':groupId', $group);
  387
+    $query->setParameter('groupId', $group);
388 388
     $ids = $query->getResult();
389 389
 
390 390
 Get all users that have more than 1 phonenumber
Commit_comment_tip

Tip: You can add notes to lines in a file. Hover to the left of a line to make a note

Something went wrong with that request. Please try again.