嗨,每个人,我实际上对教义有问题(Symfony2项目)所以实际上我有一个文档"问题",它引用了"$ref"标签,这是"类别"文档中的标签,但我收到我无法理解的错误。我在教义文档中搜索但没有找到解决方案,这是代码:
use DoctrineODMMongoDBMappingAnnotations as MongoDB;
/**
*@MongoDBDocument(repositoryClass="ATSQuizzBundleDocumentCategoryRepository")
*/
class Category {
/**
* @MongoDBId
*/
protected $id;
/**
* @MongoDBString
*/
protected $label;
/**
*@MongoDBint
*@ReferenceMany(targetDocument="Question")
*/
protected $ref ;
}
我收到此错误:
[Semantical Error] The annotation "@MongoDBDocument" in class ATSQuizzBun
dleDocumentCategory was never imported. Did you maybe forget to add a "us
e" statement for this annotation?
此处的正确注释是 @MongoDBReferenceMany
。