I am using Zf2 and Doctrine2.
What I am trying to accomplish is to write an event subscriber that can determine which objectmanger (EntityManager/DocumentManager) is being used and dynamically map a model class to a table or document.
How would I map the model to the doctrine configuration and what driver would I use?
Can I set the table and field names dynamically in a configuration file somewhere?
Is this possible and if so, please point me in the right direction.
Here is an example:
<?php
class Model
{
protected $id;
protected $name;
protected $data;
}
I would like to map this one model to both ORM\ODM with the possibilty of changing property names.
Please advise.