On Thursday, 24 April 2014 20:46:07 UTC+2, Guilherme Silveira wrote: > > I'm using a module that define some entities (already marked with > @Entity<https://github.com/Entity> > ). I need to extend this class, adding new fields, etc.. It's possible to > do that? >
I'm not sure if it would be possible (to extend another class) from a Doctrine enitity, but it will probably give more problems than that you will gain with it. I do 2 things when 'extending' a Doctrine Entity: - or I use *composition *instead of inheritance: just use an entity in another object. I preferably use constructor injection. The extended object then not '*is *an' entity, but '*has *an' entity. - or, if inheritance is the best solution, I bring the new extended class into my model: I define a new entity with one of the three possible *inheritance configurations* within an ORM (single table, class table or concrete table inheritance). Hope this helps. Otherwise, please give a practical example of what you want to accomplish. -- 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.
