Using Traits in Doctrine Entities

Hi Nicolas,

If you’re using YML or XML annotations, you will have to duplicate column declarations in the YML or XML mapping files, but you can still use the traits to avoid declaring properties and getters/setters in each of your entities.

You may be interested in a great new feature of Doctrine ORM 2.5 (not released yet) called Embeddables. There is a nice example about it in the documentation: http://doctrine-orm.readthedocs.org/en/latest/tutorials/embeddables.html