Jira issue originally created by user vmattila:
If @ManyToOne (and apparently any other association annotation) contains targetEntity with "wrongly" defined fully qualified class name in format like My\Entity\Class, Fatal error "Cannot redeclare class" is raised when running command to generate schema.
It would be more intuitive (and save some debugging hours ;) if a proper exception of wrongly defined class name would be raised.
Comment created by cordoval:
i haven't tried annotations yet but in yml and on master this gives me:
The target-entity Acme\DemoBundle\Entity\UserX cannot be found in 'Acme\DemoBundle\Entity\Category#users
let me try annotations ...
yeah this should be pretty much closed @ocramius @beberlei
Comment created by @ocramius:
Copied comment from 2844:
The issue should try to create a mapping of the kind
explicitly using two backslashes in the namespace seperator and try if an error occurs. This might be autoloader and Operating System dependent. Even if there is no error, we should fix "Doctrine\ORM\Mapping\ClassMetadataInfo" to replace double backslashes everywhere with one backslash correctly. This affects targetEntity and DiscrimnatorMap.
I'd rather throw an exception to warn the user about the abuse of backslashes.
Moved to doctrine common, since it's an issue with how metadata is being loaded when referenced
Provided a hotfix at #309
Comment created by @doctrinebot:
A related Github Pull-Request [GH-309] was closed:
After discussing this on #309, it turned out that we shouldn't fix incorrect backslash escaping in annotations.
Issue was closed with resolution "Won't Fix"