2
我想实现类别和子类别结构实体,但命令php app/console generate:doctrine:entities RFQIronilBundle
发电实体,当我结束了这个错误:语义错误 - 找不到固定X,类...错误
[Doctrine\Common\Annotations\AnnotationException]
[Semantical Error] Couldn't find constant production, class RFQ\IronilBundl
e\Entity\ProductionType.
我创建的ProductionType实体:
<?php
namespace RFQ\IronilBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* ProductionType
*
* @ORM\Table(production-type)
* @ORM\Entity
*/
class ProductionType
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\Column(type="string", length=100)
*/
protected $name;
/**
* @ORM\OneToMany(targetEntity="ProductionType", mappedBy="parent")
**/
protected $children;
/**
* @ORM\ManyToOne(targetEntity="ProductionType", inversedBy="children")
* @ORM\JoinColumn(name="parent_id", referencedColumnName="id")
**/
protected $parent;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
}
如何生成我的实体以及可能导致此错误的原因是什么? 谢谢!
是的,那是我愚蠢的错误!有时我看不到语法错误,但我很高兴有程序员可以帮忙。谢谢! – RydelHouse
新鲜的眼睛,就是这样。 – qooplmao