I am using the Doctrine Module for ORM functionality in Zend Framework 2. I am trying to build a modular architecture based on Zend Skeletton Application which makes it possible to override and extend functionality from module A in module B. I will also have to extend entities just by plugin in a new module.
Now my problem is that the xml schema for entities is very static in module A. There is no possibility to override it with module B. I thought of implementing a service which tells the doctrine module where to find the xml schema to use for a specific entity, but thats not enough.
For example when module B extends module A but module C also extends module A - which xml schema to use - from module B or from module C ? So I want to build the xml schema dynamically from two or more schema files - one in module B and one in module C.
Which is the best way to realize such architecture ? Is it a good approach to write a Service which can be invoked from all modules to collect all xml schema files ? How to tell Doctrine to merge these files ? Is there a better way then touching the Doctrine Module - for example in a config file ?