开发者

Doctrine DQL and Namespaces (relative only?)

开发者 https://www.devze.com 2023-01-08 23:29 出处:网络
i noticed that if i try to do s开发者_Python百科oemthing like $query = $em->createQuery(\'SELECT u FROM \\Application\\Entities\\User u\');

i noticed that if i try to do s开发者_Python百科oemthing like

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

i get

[Semantical Error] line 0, col 14 near '\Application\Entities\User': Error: Class '\' is not defined.

if i do

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

its ok. so the question is, can i say that DQL only accepts relative namespaces in DQL statements?


i found the answer at doctrine forums

There are no "relative" namespaces in strings

It must be the fully qualified class name minus the beginning \

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号