/**
  * @param ClassMetadataInfo $metadata
  * @param string $outputDir
  * @param Closure $collectionNameBuilder
  */
 public function generate(ClassMetadataInfo $metadata, $outputDir, Closure $collectionNameBuilder)
 {
     $tpl = file_get_contents(CodeGeneratorHelper::absPath(EntityCollectionTemplate::class, RootPath::path()));
     $tplNs = CodeGeneratorHelper::ns(EntityCollectionTemplate::class);
     $tplSimpleName = CodeGeneratorHelper::simpleName(EntityCollectionTemplate::class);
     $entityFqcn = CodeGeneratorHelper::simpleName(EntityFqcn::class);
     $collectionClassName = $collectionNameBuilder($metadata->getName());
     $code = CodeGeneratorHelper::render($tpl, array($tplNs => CodeGeneratorHelper::ns($collectionClassName), $tplSimpleName => CodeGeneratorHelper::simpleName($collectionClassName), $entityFqcn => CodeGeneratorHelper::fqn($metadata->getName())));
     CodeGeneratorHelper::save($collectionClassName, $code, $outputDir);
 }
 public function getQueryCollectionNamespace($fullClassName)
 {
     return CodeGeneratorHelper::ns($this->getQueryCollectionClassNameByEntityClass($fullClassName));
 }