我正在尝试使用学说 2 实现三级继承模型,如下例所示:
1 级实体:
/**
* @ORM\Entity
* @ORM\InheritanceType("JOINED")
* @ORM\DiscriminatorColumn(name="discr", type="string", length=50)
* @ORM\DiscriminatorMap({"Factura"="Factura", "NotaEntrega"="NotaEntrega", "Giro"="Giro", "FacturaNormal"="FacturaNormal", "FacturaPeriodica"="FacturaPeriodica"})
*/
class Cobro { ... }
2 级实体:
/**
* @ORM\Entity
*/
class Factura extends Cobro { ... }
3 级实体:
/**
* @ORM\Entity
*/
class FacturaNormal extends Factura { ... }
但是当我尝试为实体“Factura”创建获取器和设置器时......
php app/console doctrine:generate:entities MiAlarma/FacturaBundle/Entity/Factura
我收到以下错误:
Fatal error: Call to undefined method Doctrine\ORM\Mapping\MappingException::nameIsMandatoryForDiscriminatorColumns() in /var/www/sf5/vendor/doctrine/lib/Doctrine/ORM/Mapping/ClassMetadataInfo.php on line 1944
我究竟做错了什么?