Skip to content


DCOM-58: Having class named Entity in the global namespace, interferes with the new annotation reader. #658

doctrinebot opened this Issue · 2 comments

2 participants


Jira issue originally created by user napsi:

Having a class named Entity in the global namespace, results in exceptions: "Class xxx is not a valid entity or mapped super class."
The problem is not present in 2.0

The problem:

line 421: $reflClass = new \ReflectionClass($name);

$name is "Entity", and the reflection finds the non-doctrine Entity-class in the global namespace, and so doesn't find the "@Annotation" it's looking for when it examines the class.

If I force it to reflect on \Doctrine\ORM\Mapping\Entity instead, the next problem is instantiation:

line 435: return new $name($values);

Forcing that to the right class, brings a "Failed opening required 'Doctrine/ORM/Mapping/Doctrine/ORM/Mapping/Id.php' " - I haven't investigated further (yet at least).



Comment created by @guilhermeblanco:

Fixed 4810832


Issue was closed with resolution "Fixed"

@doctrinebot doctrinebot added the Bug label
@doctrinebot doctrinebot added this to the 2.2 milestone
@doctrinebot doctrinebot closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.