Thanks for your answer! Actually, It's implemented right! Let me explain... - I have AbstractUser, that implement a lot of things, it's marked as @MappedSuperclass, and I have external module that create a usable User (concrete class), so if you don't need anything else, you can use it. But if you need more fields, only create new entity, extending from AbstractUser and all work.. About functionality I think everything is ok, my problem is...
When I call `doctrine orm:schema-tool:create`, for example, I receive an exception saying table User already is using (the first is default User from external module, and the second one is my new User entity, that I added some fields)! My problem is generate the schema because I had defined two User class... It makes sense? Regards, Em sexta-feira, 25 de abril de 2014 03h17min21s UTC-3, Herman Peeren escreveu: > > 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.
