运行app/console doctrine:schema:update --force
但返回:
[Symfony\Component\Debug\Exception\FatalErrorException]
Parse Error: syntax error, unexpected '/', expecting '&' or variable (T_VARIABLE)
,这是包含错误的文件:
<?php
namespace Admin\Store\Product\Type\TypeBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Type
*
* @ORM\Table()
* @ORM\Entity
*/
class Type
{
/**
* @var integer
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @ORM\OneToOne(targetEntity="Admin/Store/Product/Type/TypeBundle/Entity/Kind")
*/
private $kind;
/**
* Get id
*
* @return integer
*/
public function getId()
{
return $this->id;
}
/**
* Set kind
*
* @param \Admin\Store\Product\Type\TypeBundle\Entity\Admin/Store/Product/Type/TypeBundle/Entity/Kind $kind
*
* @return Type
*/
public function setKind(\Admin\Store\Product\Type\TypeBundle\Entity\Admin/Store/Product/Type/TypeBundle/Entity/Kind $kind = null)
{
$this->kind = $kind;
return $this;
}
/**
* Get kind
*
* @return \Admin\Store\Product\Type\TypeBundle\Entity\Admin/Store/Product/Type/TypeBundle/Entity/Kind
*/
public function getKind()
{
return $this->kind;
}
}
所有动作都是使用symfony的控制台完成的,我实际上根本没碰到任何东西! 但我不明白错误的来源。
答案 0 :(得分:1)
试试这样:
public function setKind(\Admin\Store\Product\Type\TypeBundle\Entity\Kind $kind = null)