Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

DDC-1069 #20

Closed
wants to merge 1 commit into from

2 participants

@mridgway

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

@beberlei
Owner

Merged

@beberlei beberlei closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 14, 2011
  1. Removed : from parameter names in setParameter examples

    Michael Ridgway authored
This page is out of date. Refresh to see the latest.
Showing with 5 additions and 5 deletions.
  1. +5 −5 en/reference/dql-doctrine-query-language.rst
View
10 en/reference/dql-doctrine-query-language.rst
@@ -268,7 +268,7 @@ With WHERE Clause and Named Parameter:
<?php
$query = $em->createQuery('SELECT u FROM ForumUser u WHERE u.username = :name');
- $query->setParameter(':name', 'Bob');
+ $query->setParameter('name', 'Bob');
$users = $query->getResult(); // array of ForumUser objects
With Nested Conditions in WHERE Clause:
@@ -278,9 +278,9 @@ With Nested Conditions in WHERE Clause:
<?php
$query = $em->createQuery('SELECT u from ForumUser u WHERE (u.username = :name OR u.username = :name2) AND u.id = :id');
$query->setParameters(array(
- ':name' => 'Bob',
- ':name2' => 'Alice',
- ':id' => 321,
+ 'name' => 'Bob',
+ 'name2' => 'Alice',
+ 'id' => 321,
));
$users = $query->getResult(); // array of ForumUser objects
@@ -384,7 +384,7 @@ Get all users who are members of $group.
<?php
$query = $em->createQuery('SELECT u.id FROM CmsUser u WHERE :groupId MEMBER OF u.groups');
- $query->setParameter(':groupId', $group);
+ $query->setParameter('groupId', $group);
$ids = $query->getResult();
Get all users that have more than 1 phonenumber
Something went wrong with that request. Please try again.