I am new to Doctrine and trying to run DQL statements with the Doctrine CLI tool for convenience in debugging. My configuration appears to be set up correctly in cli-config.php. I can run things like vendor/bin/doctrine orm:info
and generate setters and getters. In my Zend Framework 2 web application I can get my entity repository from the service manager, manipulate entities, run some DQL through createQuery(), and so on. So this works in a controller action:
$query = $em->createQuery('SELECT j FROM Application\Entity\Judge j');
$judges = $query->getResult();
printf("we got %d judges in our table",count($judges));
But when I try, for example, to
vendor/bin/doctrine orm:run-dql 'SELECT j FROM Application\Entity\Judge j'
I get:
[Doctrine\ORM\Query\QueryException]
[Semantical Error] line 0, col 14 near 'Application\Entity\Judge': Error: Class 'Application\Entity\Judge' is not defined.
And I have tried this with a number of entity classes. Any thoughts?
Thanks.