是否有可能拥有一个扩展学说实体并保持它的 php 类?
例子:
/**
* @Entity
*/
class A {
/**
* @ORM\ManyToMany(targetEntity="C", mappedBy="parents")
*/
protected $children;
}
class B extends A {
...
}
class C {
/**
* @ORM\ManyToMany(targetEntity="A", inversedBy="children")
*/
protected $parents;
}
$b = new B();
$em->persist($b);