ZF-Commons / ZfcUserDoctrineORM

Doctrine2 ORM storage adapter for ZfcUser.
BSD 3-Clause "New" or "Revised" License
89 stars 92 forks source link

Cannot redeclare class ZfcuseUserDoctrineORM\Entity\User #2

Closed ahoseinian closed 12 years ago

ahoseinian commented 12 years ago

when try to get resutls form a entity that have relation with zfcuser entity like

@ORM\ManyToOne(targetEntity="ZfcUserDoctrineORM\Entity\User") @ORM\JoinColumn(name="user_id" , referencedColumnName="user_id")

if user in not login and session is not set it returns this error Fatal error: Cannot redeclare class ZfcuseUserDoctrineORM\Entity\User in C:\wamp\www\hesabketab\container-root\vendor\ZfcUserDoctrineORM\src\ZfcUserDoctrineORM\Entity\User.php on line 6

but when u land on same page with logged in browser there is no problem

thomaslhotta commented 12 years ago

Same error here. I get it when trying to create the schema with the doctrine command line tool.

thomaslhotta commented 12 years ago

I found a solution for my problem. The issue is with the way doctrine deals with autoloaders that does not seem to be compatible with the Zend ClassMapAutoloader. I removed the ZfcUserDoctrineORM\Entity\User entry from the classmap file and the problem disappeared.

Might be that i have a config error somewhere that caused the problem in the first place.

ghost commented 12 years ago

Outdated issue. Fixed with the new beta4 merge.

bgallagher commented 12 years ago

I'm getting this error too from bin/doctrine-module orm:schema-tool:update --dump-sql

I'm using annotated php classes, my guess is that doctrine and zend are both loading the class.

vagovszky commented 11 years ago

I have same problem on ZF 2.0.4 dev

bgallagher commented 11 years ago

I switched to using xml mappings and still having the issue, so not related to annotations.