I agree with Jasper's suggested approach, this is also what I meant with
"put the roles on Product as properties"
Product{
$owners;
$manufacturers;
}
In case you expect the roles to change a lot, you can have a look at the
PartyRelationship and PartRole pattern, but this is probably overkill for
your use case ;)
Cheers!
On Jan 10, 2014 1:53 PM, "Jasper N. Brouwer" <[email protected]> wrote:
> Yes, using @MappedSuperclass on the abstract Party should work.
>
> Another way to go is to have the properties $owner and $producer in
> Product, which are OneToMany associations towards Party. You don't need the
> property $role in Party, because the role is deferred from the Product
> itself.
> The only drawback is that adding new roles to your product is less easy
> (you'll have to create an extra property for that, in stead of just adding
> a new Party implementation).
>
> --
> Jasper N. Brouwer
> (@jaspernbrouwer)
>
>
> On 10 Jan 2014, at 13:48, David R <[email protected]> wrote:
>
> > Thank you for you fast reply.
> >
> > I have just read Party pattern.
> > So better model should be :
> >
> > abstract class Party
> > - role attribute (owner or producer)
> >
> > class Product
> > - arraycollection parties 1 <------> n Party
> >
> > class Person extends Party
> > class Company extends Party
> >
> > Can I implement this with doctrine @SuperClass including "role"
> attribute in my abstract Party class ?
> >
> > Thanks
> > David.
>
> --
> 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/groups/opt_out.
>
--
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/groups/opt_out.