DQL doctrine and namespaces (relative only?)

I noticed that if I try to do something like

$query = $em->createQuery('SELECT u FROM \Application\Entities\User u');

I get

[Semantic error] row 0, column 14 near '\ Application \ Entities \ User': Error: class '\' is not defined.

if i do

$query = $em->createQuery('SELECT u FROM Application\Entities\User u');

this is normal. so the question is, can I say that DQL allows relative namespaces in DQL expressions?

+5
source share
1 answer

I found the answer on doctrine forums

No "relative" namespaces per line

It must be a fully qualified class name minus start \

+8
source

All Articles