错误“无需处理元数据类”。当在Symfony(使用Doctrine)中生成DB表时,使用php app / console doctrine:generate:entity创建 [英] Error "No Metadata Classes to process." when generating DB tables in Symfony (using Doctrine) created using php app/console doctrine:generate:entity
问题描述
Symfony新手在这里!我安装了Symfony,我做了一个控制器和一个动作,一些HTML正确显示。所以,Symfony工作正常。我有一个问题在数据库中创建实体表。我创建了一些实体使用(注释和一些其他方式做出这些 - 我尝试了几种不同的方式通过控制台,实现相同的结果实体)。要创建我使用的实体:
php app / console doctrine:generate:entity
然后,当我尝试将其刷新到数据库(为了创建表),我使用这个命令:
php app / console doctrine:schema:update --force
运行该命令后,得到此错误,并且 - 正如我预期的 - 不创建表:
我尝试清除symfony缓存。
我检查AppBundle是在AppKernel中注册的。
我检查了在实体管理器中的自动映射设置为true。
我在这里缺少什么?为了提醒你,我刚刚安装了一个新的Symfony,并执行了我上面描述的步骤。我感谢您的帮助,因为我真的需要这个,因为我想学习Symfony。
解决方案我删除了整个bundle,控制台,然后通过控制台创建表,这一次它工作。我仍然不知道我以前的Symfony设置有什么问题。
Symfony newbie here! I installed Symfony and I made a controller and an action and some html is displayed properly. So, Symfony is working fine. I have a problem creating entity tables in the database. I created some entities using (annotations and some other way of making those - I tried couple of different ways of making entities through console, with same result). To create entities I used:
php app/console doctrine:generate:entity
And then, when I try to flush it to the database (in order to create the table(s)), I use this command:
php app/console doctrine:schema:update --force
After running that command, I get this error, and - just as I expected - the tables are not created:
I tried to clear the symfony cache.
I checked AppBundle is registered in AppKernel.
I checked that auto mapping is set to true in entity manager.What am I missing here? To remind you, I have just installed a fresh Symfony and did the steps I described above. I appreciate your help since I really need this because I want to learn Symfony.
解决方案I deleted whole bundle, and created bundle through console, and then created tables through console, and this time it worked. I still don't know what was wrong with my previous setting(s) of Symfony.
这篇关于错误“无需处理元数据类”。当在Symfony(使用Doctrine)中生成DB表时,使用php app / console doctrine:generate:entity创建的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!