douxin8610 2015-11-13 13:13
浏览 44
已采纳

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

Running app/console doctrine:schema:update --force but it returns:

[Symfony\Component\Debug\Exception\FatalErrorException]                            
Parse Error: syntax error, unexpected '/', expecting '&' or variable (T_VARIABLE)

and here is the file containing the error:

<?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;
    }
}

All actions have been done using symfony's console and I actually didn't touch anything at all! But I don't understand where does the error come from.

  • 写回答

1条回答 默认 最新

  • dongyi9023 2015-11-13 13:21
    关注

    Try like this:

    public function setKind(\Admin\Store\Product\Type\TypeBundle\Entity\Kind $kind = null)
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置
  • ¥15 有没有研究水声通信方面的帮我改俩matlab代码
  • ¥15 ubuntu子系统密码忘记