mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-2398: Add a "use namespace" like feature to DQL to have short/reusable entity classname #3009
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 (Apr 11, 2013).
Originally assigned to: @Ocramius on GitHub.
Jira issue originally created by user quazardous:
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');