mirror of
https://github.com/doctrine/orm.git
synced 2026-03-24 06:52:09 +01:00
DDC-379: Implement entity aliases #472
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 (Feb 26, 2010).
Originally assigned to: @jwage on GitHub.
Jira issue originally created by user @jwage:
Similar to how you can use the "use" statement in PHP, it would be nice if DQL had a concept of a default namespace or something.
If I am inside the MyBundle namespace I would want to set something that would allow me to just reference it like this:
@doctrinebot commented on GitHub (Feb 26, 2010):
Comment created by romanb:
Have you thought about how to implement this? I have thought about this before but I always end up with the conclusion that an implementation would be too cumbersome compared to the minimal "benefit" you get out of this.
@doctrinebot commented on GitHub (Feb 26, 2010):
Comment created by @beberlei:
The problem here is really that an alias registered in the metadata won't work, since the class and its ocrresponding alias might not been loaded when the alias is requested.
Therefore the only simple and working solution would be to allow an "aliasMap" configuration key inside ORM\Configuration and ClassMetadataFactory checks it like:
@doctrinebot commented on GitHub (Feb 26, 2010):
Comment created by @jwage:
I have not looked into making something like this work. I realize it might not be something necessarily trivial to implement, and it may not work. I'm just opening the discussion on the topic.
Benjamin, I tried to run with your idea and make something work, but I couldn't get anything working. Did you try it?
I tried something like this:
@doctrinebot commented on GitHub (Feb 26, 2010):
Comment created by @jwage:
Fixed in r7231
@doctrinebot commented on GitHub (Mar 1, 2010):
Comment created by romanb:
Please see my comment on DDC-384. Unless I am missing something the implementation in getMetadataFor is very broken and I dont see a good way to fix it.
@doctrinebot commented on GitHub (Mar 1, 2010):
Comment created by romanb:
Reopening because caching is severely broken.
@doctrinebot commented on GitHub (Mar 1, 2010):
Comment created by romanb:
This could probably be fixed by checking the cache again after resolving the fully class name:
@doctrinebot commented on GitHub (Mar 2, 2010):
Comment created by @guilhermeblanco:
In r7300 this enhancement was committed.
@doctrinebot commented on GitHub (Mar 2, 2010):
Issue was closed with resolution "Fixed"