【发布时间】:2013-12-04 09:15:37
【问题描述】:
我想向促销实体添加独家/包容性产品。 尝试生成映射表时名称冲突。
喜欢:
两个表的promotion_product
promotion.orm.yml
manyToMany:
productsIncluded:
targetEntity: Acme\Bundle\DemoBundle\Entity\Product
productsExcluded:
targetEntity: Acme\Bundle\DemoBundle\Entity\Product
我猜这是可以实现的,但是有这样的东西:
manyToMany:
productsIncluded:
targetEntity: Acme\Bundle\DemoBundle\Entity\Product
joinTable:
name: promotion_included_product
joinColumns:
promotion_id:
referencedColumnName: id
inverseJoinColumns:
product_id:
referencedColumnName: id
productsExcluded:
targetEntity: Acme\Bundle\DemoBundle\Entity\Product
joinTable:
name: promotion_excluded_product
joinColumns:
promotion_id:
referencedColumnName: id
inverseJoinColumns:
product_id:
referencedColumnName: id
这是一种方式吗?还是 symfony auto 有更简单/更简洁的方式来处理这个问题?
告诉我谢谢。
【问题讨论】:
标签: php symfony doctrine-orm many-to-many