我是 symfony 的初学者。我试图按照官方文档http://symfony.com/doc/current/cookbook/doctrine/reverse_engineering.html将实体从 MySQL 导入 Debian 测试框中的 symfony2 项目。但我没有成功。
然后在这里和那里搜索,我发现这里使用 symfony2 和教义从现有数据库生成单个实体,但我无法使其工作,我的控制台:“要求 Doctrine 内省数据库并生成相应的元数据文件”
root@khs01wxl001:/var/www/organizer$ php app/console doctrine:mapping:import --force organizerscheduleBundle php
Importing mapping information from "default" entity manager
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Dept.orm.php
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Desg.orm.php
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Dir.orm.php
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Schedule.orm.php
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Username.orm.php
> writing /var/www/organizer/src/organizer/scheduleBundle/Resources/config/doctrine/Userrole.orm.php
root@khs01wxl001:/var/www/organizer$
到目前为止一切顺利,但是现在“您可以通过执行以下两个命令来要求 Doctrine 构建相关的实体类。
$ php app/console doctrine:mapping:convert annotation ./src
$ php app/console doctrine:generate:entities AcmeBlogBundle
但是当我这样做时,第一个对我不起作用:
root@khs01wxl001:/var/www/organizer$ php app/console doctrine:mapping:convert annotation ./src/organizer/scheduleBundle/Resources/config/doctrine/
No Metadata Classes to process.
root@khs01wxl001:/var/www/organizer$
有什么建议吗?