Hey Tales, No, the ORM won't be able to support what you want there. The current persisters/hydrators for JTI and STI structures require a discriminator column to be defined and populated with correct information.
Marco Pivetta http://twitter.com/Ocramius http://ocramius.github.com/ On 7 July 2016 at 02:00, Thales Maciel <[email protected]> wrote: > Hello! > > Is there a way to produce OO inheritance without providing a discriminator > column and a discriminator map? > Instead, I'd like to specify the name of the column to be used to > reference the top-most entity's table's primary key. Seems that doctrine2 > automatically assumes the foreign key's name to be the same as the > referenced tables' primary key's name, which often isn't the case for > legacy databases. > > Instead of what is in red, I'd like to do something like what is in green. > =) > > <?phpnamespace MyProject\Model; >> /** * @Entity *@Table(name="person")* * @InheritanceType("JOINED")* * >> @DiscriminatorColumn(name="discr", type="string") >> * @DiscriminatorMap({"person" = "Person", "employee" = "Employee"})* >> */class Person{ >> // ...} >> /** @Entity *@Table(name="employee") @JoinColumn(name="employee.person_id", >> referencedColumnName="person.id <http://person.id>")* */ >> >> class Employee extends Person{ >> // ...} >> >> > > Thanks a lot for the help. > > -- > 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 https://groups.google.com/group/doctrine-user. > For more options, visit https://groups.google.com/d/optout. > -- 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 https://groups.google.com/group/doctrine-user. For more options, visit https://groups.google.com/d/optout.
