Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-1069

setParameter[s]() examples on DQL page uses ":" even though that is not supported

    Details

    • Type: Documentation Documentation
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 2.0.2
    • Fix Version/s: 2.0.4
    • Component/s: ORM
    • Security Level: All
    • Labels:
      None

      Description

      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.

        Activity

        André R. created issue -
        Benjamin Eberlei made changes -
        Field Original Value New Value
        Status Open [ 1 ] Resolved [ 5 ]
        Resolution Fixed [ 1 ]
        Benjamin Eberlei made changes -
        Fix Version/s 2.0.4 [ 10130 ]
        Fix Version/s 2.0.3 [ 10117 ]
        Fix Version/s 2.1 [ 10022 ]
        Christian Stoller made changes -
        Priority Major [ 3 ] Minor [ 4 ]
        Component/s ORM [ 10012 ]
        Component/s Documentation [ 10013 ]
        Benjamin Eberlei made changes -
        Workflow jira [ 12468 ] jira-feedback [ 14794 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback [ 14794 ] jira-feedback2 [ 16658 ]
        Benjamin Eberlei made changes -
        Workflow jira-feedback2 [ 16658 ] jira-feedback3 [ 18911 ]

          People

          • Assignee:
            Benjamin Eberlei
            Reporter:
            André R.
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: