To revive this thread: I find myself increasingly using Traits to isolate and inject often used functionality into Entities, like Timestampable <https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/timestampable.md> :
When using PHP Annotations for the ORM Mapping, this Trait can be used: https://github.com/Atlantic18/DoctrineExtensions/blob/master/lib/Gedmo/Timestampable/Traits/TimestampableEntity.php However, in my opinion ORM Mapping should be decoupled from the domain model, therefore I use XML mapping files. In that case this Trait can be used: https://github.com/Atlantic18/DoctrineExtensions/blob/master/lib/Gedmo/Timestampable/Traits/Timestampable.php But this would require to change the XML Mapping of the Entity that *uses* the Trait. From my point of view the UseCase to support a mechanism to provide ORM metadata of a Trait using XML / YAML files and re-use it in various Entity mappings is clear. Do the maintainers agree or disagree with this stance? Cheers On Monday, 8 December 2014 22:12:55 UTC+1, Sebastian Krebs wrote: > > Hi, > > This bundle introduces new elements for it's mapping, but doesn't support > custom traits. it can show how to solve this issue for specific cases > though. > > Regards, > Sebastian > > 2014-12-08 19:55 GMT+01:00 scott molinari <[email protected] > <javascript:>>: > >> This bundle for Symfony to extend Doctrine with traits says it also uses >> yaml and xml for mapping. I haven't dug into the code, but maybe your >> answer is in this bungle? >> >> https://github.com/Atlantic18/DoctrineExtensions >> >> Scott >> >> -- >> You received this message because you are subscribed to the Google Groups >> "doctrine-user" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> To post to this group, send email to [email protected] >> <javascript:>. >> Visit this group at http://groups.google.com/group/doctrine-user. >> For more options, visit https://groups.google.com/d/optout. >> > > > > -- > github.com/KingCrunch > -- You received this message because you are subscribed to the Google Groups "doctrine-user" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
