Tuesday, 15 July 2014

doctrine2 - Switching Doctrine Entity in Zend Framework 2 -



doctrine2 - Switching Doctrine Entity in Zend Framework 2 -

i have 2 modules. 1) user module , 2) rbacuser module. rbacuser module depended on user module. extend "user entity" user module in rbacuser module , add together new attributes user entity roles etc.

what is, when used rbacuser module, make rbacuser module user entity default. schema tool know entity should utilize create table ?

in short words:

if user module used create user entity default

or

if rbacuser module used create user entity default , ignore user's entity.

i found solution

these configuration of both modules

user module config file

user\config\module.config.php 'driver' => array( 'user_driver' => array( 'class' => 'doctrine\orm\mapping\driver\annotationdriver', 'cache' => 'array', 'paths' => array( __dir__.'/../src/user/entity', ), ), 'orm_default' => array( 'drivers' => array( 'user\entity\user' => 'user_driver' ) ) ),

rbacuser module config file

rbacuser\config\module.config.php 'doctrine' => array( 'driver' => array( 'rbacuser_driver' => array( 'class' => 'doctrine\\orm\\mapping\\driver\\annotationdriver', 'cache' => 'array', 'paths' => array( __dir__.'/../src/rbacuser/entity', ), ), 'orm_default' => array( 'drivers' => array( 'rbacuser\entity\user' => 'rbacuser_driver' ) ) ) )

if don't utilize "user" module doctrine driver config problem solved. is way check if rbacuser module used don't utilize doctrine driver configuration in "user" module

you must implement identityprovider in rbacuser module , specify this configuration key

doctrine2 annotations zend-framework2 database-schema

No comments:

Post a Comment