Le 21/06/2011 16:54, Ваня Масич a écrit :
I see that base EntityRepository class already have __call method for findBy queries, and I think that extend this type of class is not needed, I can use query bilder or DQL for this feature.

But how about Entity class, if I want add some new fields, how I can extend it without change source code of bundle?

Entities are not meant to be extendable at will due to the way they work. The entity inheritance is not a way to change the entity from bundles as it requires changes in the parent classes and has bad performances. The solution to make a shared bundle extensible is to provide a mapped superclass instead of an entity. This will force the user to implement the entity himself by extending the mapped superclass but it gives flexibility. See https://github.com/FriendsOfSymfony/UserBundle for an example

--
Christophe | Stof

--
If you want to report a vulnerability issue on symfony, please send it to 
security at symfony-project.com

You received this message because you are subscribed to the Google
Groups "symfony users" group.
To post to this group, send email to symfony-users@googlegroups.com
To unsubscribe from this group, send email to
symfony-users+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en

Reply via email to