Le 25/11/2014 19:46, Sebastian Krebs a écrit :
Hi,

Very simple question: Is it possible to use XML (or yaml, ... anything else than annotations ;)) with traits?

Regards,
Sebastian
It depends of what you want to achieve. You can define mapping for fields provided by a trait, but you need to define it as if fields were directly in the class using the trait. You cannot provide mapping for the trait itself.

This is logical given the way traits are working in PHP. They are compiler-based copy/paste. They don't exist during the runtime of the class. The reason why annotations can be defined in an handy way for traits is because they are copy/pasted too (but the loading is actually done for the class, not for the trait)

--
Christophe | Stof

--
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.

Reply via email to