On Tuesday, 11 March 2014 10:27:11 UTC+1, Parsifal wrote:
>
> Thanks for kind helps. In my case should I just use "JOINED"? I have not 
> seen this constant name in the list on constant in API site you gave me the 
> link?
>
*INHERITANCE_TYPE_JOINED*<http://www.doctrine-project.org/api/orm/2.4/source-class-Doctrine.ORM.Mapping.ClassMetadataInfo.html#58-62>
 is 
a constant used inside ClassMetadataInfo. It has value 2. When you call it 
from your PHP-code, I assume you'll first have to define a constant for it 
yourself, for it is probably not globally defined. You can name that 
constant anything you want. 

In the example you gave in the other thread with Type1, Type2 etc. as 
extended from Type, where Type has its own table, you probably should use 
Class Table inheritance. But it depends of your model and mapping. The 
different inheritance types have advantages and disadvantages (as you can 
read in the documentation too). It is always a trade-off between 
performance and convenience/flexibility. That depends on the requirements 
and priorities in your domain. Trade-off decisions are what makes 
programming an "art".

In the example with Clients and Orders you should not use inheritance. But 
the direction of the OneToMany/ManyToOne association must be correct. In 
this case: a client can have multiple orders, but an order can only have 
one client. 

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