mercredi 1 avril 2015

symfony2 doctrine bundle entity override / replacing

I'm having issues specific to Doctrine ORM Entity mapping and overriding vendor entities from the EkinoWordpressBundle. I understand there is some functionality to override the default bundle entities in the bundle. When I run doctrine:schema:update I get SchemaExceptions like 'table with name wp_users' already exists. I'm trying to figure out how to have the default doctrine mapping for an entity to be ignored from the bundle to avoid this issue.


What I have done so far is:



  1. create entities to replace the User and UserMeta from the bundle.

  2. I defined ekino.wordpress.entity.user.class: MyBundleNamespace\User and ekino.wordpress.entity.user_meta.class: MyBundleNamespace\UserMeta in config.yml

  3. I'm using doctrine.orm.resolve_target_entities to replace association references to Ekino\WordpressBundle\Entity\User and Ekino\WordpressBundle\Entity\UserMeta with my own


I'm not clear on defining custom entity managers and how that would help alleviate my issues as was suggested by the developer of the bundle http://ift.tt/1EGUAQT


Also I'm using yml based mapping definition in case that makes a difference to possible solutions.


Aucun commentaire:

Enregistrer un commentaire