0

Is it possible to create a parent name field into one-to-many association in Doctrine2.

For example, we have a Meeting. This meeting can be associated with Contacts or with Accounts.

Example of data:

     meeting_name         | parent_name | parent_id
------------------------------------------------------
Meeting with a friend     | Contacts    | <contact_id>
Meeting with the customer | Accounts    | <account_id>

Is possible to implement it in Doctrine2?

Thanks

4

1 回答 1

0

是的,当然。但是,我会使用父类的 FQDN 而不是其名称。此外,您可以创建一个自定义 hydrator

或者,您可以只创建两个多对多关系,一个用于 meeting_customer_attendees,一个用于 meeting_friend_attendees。

于 2013-07-03T14:49:20.757 回答