获取解析错误:语法错误,意外' /',期待'&'运行app / console doctrine时出现或变量(T_VARIABLE)错误:schema:update

时间:2015-11-13 13:13:51

标签: php symfony doctrine-orm doctrine

运行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的控制台完成的,我实际上根本没碰到任何东西! 但我不明白错误的来源。

1 个答案:

答案 0 :(得分:1)

试试这样:

public function setKind(\Admin\Store\Product\Type\TypeBundle\Entity\Kind $kind = null)