In the documentation I saw this method:
addEntityNamespace($alias, $namespace);
But I can't find anywhere what is it about.
Any ideas?
Entity namespaces are a shortcut to aliasing Entities when pointing to other classes. A good example of an entity namespace is inside DQL queries.
When you define a namespace, like: ->addEntityNamespace('app', 'Application\Entity'); You can then refer to them easily. In a DQL sample, instead of write this:
SELECT u FROM Application\Entity\User u
You can do that:
SELECT u FROM app:User u
I hope this helps. =)
Cheers,
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With