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.

Reply via email to