【发布时间】:2015-04-09 18:40:36
【问题描述】:
我有以下问题 - 在项目中,我有一个名为 TaggableInterface 的接口
interface TaggableInterface {
public function addTag(TagInterface $tag);
public function deleteTag(TagInterface $tag);
public function getTags();
}
它是由一些实体类实现的。
Doctrine 中有什么好的方法可以在这些实体和标签之间建立关系吗?如果 Taggable 不是接口而是抽象类,我可以通过实体继承来解决它..
如果没有 Doctrine,我可能会使用 Party/Accountability 设计模式 (http://martinfowler.com/apsupp/accountability.pdf)。
【问题讨论】:
标签: php doctrine-orm doctrine