Doctrine 2 - ORM
  1. Doctrine 2 - ORM
  2. DDC-2398

Add a "use namespace" like feature to DQL to have short/reusable entity classname

    Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Invalid
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: DQL

      Description

      I find not always portable-friendly the use of full class path in DQL.

      $query = $em->createQuery('SELECT u FROM \MyProject\Model\User u WHERE u.age > 20');

      could be :

      $query = $em->createQuery('USE \MyProject\Model SELECT u FROM User u WHERE u.age > 20');

      or :

      $query = $em->use('\MyProject\Model')->createQuery('SELECT u FROM User u WHERE u.age > 20');

      And with a default namespace attached to the entity manager :

      $query = $em->use()->createQuery('SELECT u FROM User u WHERE u.age > 20');

        Activity

        David Berlioz created issue -
        Marco Pivetta made changes -
        Field Original Value New Value
        Status Open [ 1 ] Closed [ 6 ]
        Assignee Benjamin Eberlei [ beberlei ] Marco Pivetta [ ocramius ]
        Resolution Invalid [ 6 ]

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            David Berlioz
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: