I have a bit of Doctrine ORM code like so:
$query = $this->entityManager->createQuery('SELECT c FROM specialty\models\entities\Clan c WHERE c.Id = ?1');
This code has worked without a problem for ages. I recently reinstalled my LAMP stack environment and my Netbeans IDE and merely checked out the code from SVN. Now, however, this bit of code throws up the following error:
exception 'Doctrine\ORM\Query\QueryException' with message '[Semantical Error] line 0, col 14 near 'specialty\modelsentities\Clan': Error: Class 'specialty\modelsentities\Clan' is not defined here.'
Looking at the error message, there is a missing '\' between 'models' and 'entities'. While this ought to be '\models\entities', it is 'seen' as '\modelsentities' - which definitely does not exist - hence the error.
For some weird reason, the slash is stripped off before the code is parsed, I think. Problem is, I have not been able to find the cause of this. I observed that the problem disappears when the WHEN clause is removed from the statement like so:
$query = $this->entityManager->createQuery('SELECT c FROM specialty\models\entities\Clan c');
I have tried escaping possibly invisible control characters, checking new environment settings in php.ini (for example) for clues as to what could be cause of the error. Please help, thanks.