zendframework1-doctrine2 icon indicating copy to clipboard operation
zendframework1-doctrine2 copied to clipboard

Doctrine 2.1.6 works, 2.2 doesn't (Annotations not imported)

Open trialgod opened this issue 13 years ago • 4 comments

Hi,

iam using the newest Version of the bisna-library. In Doctrine 2.1.6 the integration works properly, but when i upgrade to Doctrine 2.2 the annotation-reading fails. I get the following:

Semantical Error] The annotation "@Table" in class Project\Entity\AclRoles was never imported. Did you maybe forget to add a "use" statement for this annotation?

What can i do here?

trialgod avatar Feb 16 '12 10:02 trialgod

I've encountered the same problem (See #23). Guilhermeblanco merged my pull request two days ago, so it should be working if you use the current master.

bountin avatar Feb 16 '12 16:02 bountin

I forgot to mention that I've changed the annotationReaderClass to the SimpleAnnotationReader:

resources.doctrine.orm.entityManagers.default.metadataDrivers.drivers.0.annotationReaderClass = "Doctrine\Common\Annotations\SimpleAnnotationReader"

bountin avatar Feb 16 '12 16:02 bountin

@bountin using the SimpleAnnotationReader will break the namespace loading for Doctrine 2.2, the default annotation reader is what works

ssmusoke avatar Mar 12 '12 14:03 ssmusoke

The problem doesn't go away if AnnotationReader is used in Doctrine 2.2.2. Changing, as @bountin suggests, to SimpleAnnotationReader works. If this is an incorrect way, then the bug still exists.

arch1t3ct avatar Apr 16 '12 12:04 arch1t3ct