mirror of
https://github.com/doctrine/orm.git
synced 2026-03-23 22:42:18 +01:00
DDC-1069: setParameter[s]() examples on DQL page uses ":" even though that is not supported #1336
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @doctrinebot on GitHub (Mar 13, 2011).
Originally assigned to: @beberlei on GitHub.
Jira issue originally created by user anderom:
http://www.doctrine-project.org/docs/orm/2.0/en/reference/dql-doctrine-query-language.html
Among others:
$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,
));
Despite this does not work and doc says "When referencing the parameters in Query#setParameter($param, $value) both named and positional parameters are used without their prefixies." on same page.
(side note: prefixies => prefixes)
Fresh on doctrine 2.0 you typically copy past examples to try out stuff, and when exception then says that ":id" is not a valid param on this query you end up not knowing what went wrong.
@doctrinebot commented on GitHub (Mar 21, 2011):
Comment created by mridgway:
I posted a simple patch for this at https://github.com/doctrine/orm-documentation/pull/20
@doctrinebot commented on GitHub (Mar 22, 2011):
Comment created by anderom:
Looks good!
@doctrinebot commented on GitHub (Mar 29, 2011):
Comment created by @beberlei:
Resolved
@doctrinebot commented on GitHub (Mar 29, 2011):
Issue was closed with resolution "Fixed"
@doctrinebot commented on GitHub (Nov 18, 2011):
Comment created by naitsirch:
You can find the same error in the *PHPDoc* of the methods setParameter(...) and setParameters(..) in class Doctrine\ORM\QueryBuilder.
It would be nice if this will be fixed, because it is confusing, if you look at the autocomplete notice of the IDEs.