Symfony2主义:生成:实体抛出语法错误? [英] Symfony2 doctrine:generate:entities throw Syntax Error?

查看:232
本文介绍了Symfony2主义:生成:实体抛出语法错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用symfony2 shell并尝试运行时

doctrine:generate:entities [MyBundle] --path='src' 

doctrine:generate:entities [MyBundle] 

我遇到此错误

[Syntax Error] Expected Doctrine\Common\Annotations\DocLexer::T_CLOSE_CURLY_BRACES, got '@' at position 255 in property

所以请提出任何解决方案

提前感谢

推荐答案

我也遇到了此错误。这只是您的Entity批注中的一个简单错字。快速检查您的实体将显示以下内容:

I've encountered this error also. It's just a simple typo in one of your Entity annotations. A quick check of your entities will reveal something like this:

/**
 * @ORM\Id
 * @ORM\Column(type="integer"              // note the missing close parentheses
 * @ORM\GeneratedValue(strategy="AUTO")
 */
protected $id;

考虑到行号,它可能在您的实体关联映射之一中。

Taking into account the line number, it's probably somewhere in one of your entity association mappings.

这篇关于Symfony2主义:生成:实体抛出语法错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆