Sha*_*ung 15 php doctrine symfony
我正在关注这本书,并在http://symfony.com/doc/current/book/doctrine.html页面上
在阅读本书后,我正在努力研究产品和类别表以及doctrine generate命令的关系,这给了我以下错误.
php app/console doctrine:generate:entities Acme
Generating entities for namespace "Acme"
[RuntimeException]
Namespace "Acme" does not contain any mapped entities.
doctrine:generate:entities [--path="..."] [--no-backup] name
Run Code Online (Sandbox Code Playgroud)
谢谢
sen*_*rio 20
同
doctrine:generate:entity
Run Code Online (Sandbox Code Playgroud)
你将创建新的实体.
当你手动添加一些属性时
doctrine:generate:entities AcmeDemoBundle:User
Run Code Online (Sandbox Code Playgroud)
您将创建AcmeDemoBundle实体User的所有访问者(getter和setter)
如果您的项目(仅?)实体的命名空间不正确,也会出现此错误.如果您运行该命令
$ php app/console doctrine:generate:entities MyBundle
Run Code Online (Sandbox Code Playgroud)
它会产生错误
[RuntimeException]
Bundle"MyBundle"不包含任何映射实体.
检查更具体的命令....
$ php app/console doctrine:generate:entities MyBundle:MyEntity
Run Code Online (Sandbox Code Playgroud)
看看你是否收到错误:
[RuntimeException]
自动加载器期望类"MyBundle\Entity\MyEntity"将在文件"/path/to/MyBundle/Entity/MyEntity.php"中定义.找到该文件但该类不在其中,类名或命名空间可能有拼写错误.
如果是这样,那么,错误说明了自己(希望如此),并且需要更正命名空间/类名.希望这对某人有帮助.