ReferenceMany 不起作用 Doctrine ODM

ReferenceMany doesn't work Doctrine ODM

大家好,我实际上对学说有疑问(Symfony2 项目) 所以实际上我有一个文档 "Question" 引用了“$ref”标签,它是 "Category" 文档中的一个标签,但我收到了我无法理解的错误。我在学说文档中搜索但没有找到解决方案,这里是代码:

use Doctrine\ODM\MongoDB\Mapping\Annotations as MongoDB;


/**
  *@MongoDB\Document(repositoryClass="ATS\QuizzBundle\Document\CategoryRepository")
*/

class Category {

/**
 * @MongoDB\Id
*/
protected $id;

/**
 * @MongoDB\String
*/
protected $label;

/**
 *@MongoDB\int
 *@ReferenceMany(targetDocument="Question")
*/
protected $ref ;
}

我收到这个错误:

  [Semantical Error] The annotation "@MongoDB\Document" in class ATS\QuizzBun  
  dle\Document\Category was never imported. Did you maybe forget to add a "us  
  e" statement for this annotation?

这里正确的注释应该是 @MongoDB\ReferenceMany