Zend framework 将多个派生实体映射到Doctrine 1.x中的单个表
我有一个实体项(比如映射到表应用程序_项),并且有几个实体是从该项派生的。派生实体包含额外的getter/setter(不包含它们各自的字段),这些getter/setter仅获取/设置父类的属性(在某些文本字段中,属性作为编码的json添加)Zend framework 将多个派生实体映射到Doctrine 1.x中的单个表,zend-framework,doctrine,command-line-interface,entities,derived,Zend Framework,Doctrine,Command Line Interface,Entities,Derived,我有一个实体项(比如映射到表应用程序_项),并且有几个实体是从该项派生的。派生实体包含额外的getter/setter(不包含它们各自的字段),这些getter/setter仅获取/设置父类的属性(在某些文本字段中,属性作为编码的json添加) 应该只生成一个表。我试图使用doctrine 1.x生成表,但它表示未定义项,即使我添加了Use\Item;还有。我想,我自己找到了这里给出的解决方案 // part of Item.php class Item { // other fields
应该只生成一个表。我试图使用doctrine 1.x生成表,但它表示未定义项,即使我添加了Use\Item;还有。我想,我自己找到了这里给出的解决方案
// part of Item.php
class Item
{
// other fields in the parent class
public $properties;
public getProperty($name)
{
// decode $properties and get $name from it
}
// getter, setters in the parent class
}
// part of DerivedEntity1.php
class DerivedEntity1 extends Item
{
public getField1($field1)
{
return $this->getProperty($field1);
}
}