I have an abstract entity model class that have inheritance type "joined".
If I want to extend that entity in another bundle, I need to add the "children class" into the discriminator map .. But if its in another bundle, that means I will need to modify the parent bundle entity every time that I want to extend that model into another bundle, and I think that this does make a little sense.
So if I want to not need to modify the abstract class discriminator map every time that I extend it with a new entity in a new bundle, is it possible to say Doctrine or SF2 that the "discr" field must equal the children entity class name + its namespace, so this way it will be way more dynamic so I don't have to edit my parent bundle every time that I want to extend it.
Mapped superclass is not a good option because I need one-to-many relationship.
So my question is clearly : How I can avoid to manually set "DiscriminatorMap" so that field be automatically set to the children class name + namespace ? (discr = inherited class name + namespace)
This is example that would be cool :
/**
* Operable
*
* @ORM\Table()
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string")
* @ORM\DiscriminatorMap(**AUTOMATIC**)
* @ORM\Entity(repositoryClass="FOO\PaymentBundle\Entity\OperableRepository")
* @ORM\HasLifecycleCallbacks
*/
abstract class Operable {
/* some good stuff */
}
Thank you very much to all of you and have a great day !