问题描述
文件或我有问题。我做了所有的文件说明。当我放入终端:
$ php vendor / bin / doctrine orm:schema-tool:create
输出是:
没有元数据类处理
我阅读了许多帖子,并且google尝试了很多例子,但没有任何内容。
我想你从:
$ isDevMode = true;
$ config = Setup :: createAnnotationMetadataConfiguration(array(__ DIR __。/ src),$ isDevMode);
现在,诀窍是,安装:: createAnnotationMetadataConfiguration 方法使用SimpleAnnotationReader默认。您可以通过将第五个参数更改为false来更改此行为:
$ isDevMode = true;
$ config = Setup :: createAnnotationMetadataConfiguration(array(__ DIR __。/ src),$ isDevMode,null,null,false);
这将强制Doctrine使用可以处理您的模型的不简单的AnnotationReader!
Something is wrong with documentation or me. I do all what documentation says.
When i put in terminal :
$ php vendor/bin/doctrine orm:schema-tool:create
Output is :
No Metadata Classes to process
I read to many posts, and google and try to many examples but nothing.
http://docs.doctrine-project.org/projects/doctrine-orm/en/latest/tutorials/getting-started.html
I think you took the config example from Doctrine2: getting started:
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode);
The trick is now that the Setup::createAnnotationMetadataConfiguration method uses a SimpleAnnotationReader by default. You can change this behaviour by changing the fifth parameter to false:
$isDevMode = true;
$config = Setup::createAnnotationMetadataConfiguration(array(__DIR__."/src"), $isDevMode, null, null, false);
This will force Doctrine to use the not-simple AnnotationReader which can handle your models now!
这篇关于Doctrine2 - 没有要处理的元数据类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!