DDC-1039: Error in DQL Example #1298

Closed
opened 2026-01-22 13:08:48 +01:00 by admin · 2 comments
Owner

Originally created by @doctrinebot on GitHub (Feb 21, 2011).

Originally assigned to: @beberlei on GitHub.

Jira issue originally created by user dalvarez:

At http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html the following example is given:

<?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', ':name' => 'Alice', ':id' => 321, )); $users = $query->getResult(); // array of ForumUser objects This can't possibly work, because the second named parameter is called name2, and the PHP array that is passed to the setParameters method has two equal keys, both named ':name'. I guess the second entry in the array should have a key ':name2'.
Originally created by @doctrinebot on GitHub (Feb 21, 2011). Originally assigned to: @beberlei on GitHub. Jira issue originally created by user dalvarez: At http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html the following example is given: <?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', ':name' => 'Alice', ':id' => 321, )); $users = $query->getResult(); // array of ForumUser objects This can't possibly work, because the second named parameter is called name2, and the PHP array that is passed to the setParameters method has two equal keys, both named ':name'. I guess the second entry in the array should have a key ':name2'.
admin closed this issue 2026-01-22 13:08:50 +01:00
Author
Owner

@doctrinebot commented on GitHub (Feb 26, 2011):

Comment created by @beberlei:

Fixed.

@doctrinebot commented on GitHub (Feb 26, 2011): Comment created by @beberlei: Fixed.
Author
Owner

@doctrinebot commented on GitHub (Feb 26, 2011):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Feb 26, 2011): Issue was closed with resolution "Fixed"
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#1298