Search code examples
doctrine-ormmodel-associationssymfony-2.1

Doctrine2 Base entity class association mapping


I have a Base entity and it's children, for example: news, discounts, gallery, etc..

What I would like to achieve is, that the Base class has an association map to the Image entity, so all it's children are automatically joined with the Image class.

Could you please give me some advice how to achieve this? Thanks


Solution

  • Whenever you have an inheritance using Doctrine, you need to follow the guidelines:

    http://doctrine-orm.readthedocs.org/en/2.0.x/reference/inheritance-mapping.html