I'm quite new to ZF2. I have a bunch of doctrine entities from my project in ZF1, one being a User entity.
I'm trying to extend \ZfcUserDoctrineORM\Entity\User so that I can inclue my old relationships - but with no great success.
If I try and run the schema generator ./doctrine-module orm:schema-tool:create
I get an error saying the table name user already exists.
So far I've tried extending the class and setting my class as the UserEntityClass
return array(
'zfcuser' => array(
'UserEntityClass' => '\Application\Entity\User',
),
);
There doen't seem to be any documentation for the module as yet.
So the problem was that the default ZfcUserDoctrineORM entities were still in play. To solve this you can set EnableDefaultEntities to false like so :
return array(
'zfcuser' => array(
'UserEntityClass' => '\Acme\Entity\User',
'EnableDefaultEntities' => false
),
);
I'm going from memory here, as I played around with ZfcUser[DoctrineORM] some time back.
You don't want to extend anything. Instead, just write your own User entity and make it implement ZfcUser\Entity\UserInterface.
Then make sure you set your configuration correctly (to use your own implementation of UserInterface, instead of the default), and you should be good to go.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With