Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName PHP Méthode

addGlobalIgnoredName() public static méthode

Add a new annotation to the globally ignored annotation names with regard to exception handling.
public static addGlobalIgnoredName ( string $name )
$name string
    public static function addGlobalIgnoredName($name)
    {
        self::$globalIgnoredNames[$name] = true;
    }

Usage Example

 /**
  * @return AnnotationReader
  */
 public static function getAnnotationReader()
 {
     if (self::$annotationReader !== null) {
         return self::$annotationReader;
     }
     //For old AnnotationReader (<=1.2.7)
     //For new (>1.2.7) version of AnnotationReader, we can give a DocParser since a3c2928912eeb5dc5678352f22c378173def16b6
     $parser = new DocParser();
     $parser->setIgnoreNotImportedAnnotations(true);
     self::$annotationReader = new AnnotationReader($parser);
     //For old version of AnnotationReader (<=1.2.7) , we have to specify manually all ignored annotations
     foreach (self::$ignoredAnnotationNames as $ignoredAnnotationName) {
         self::$annotationReader->addGlobalIgnoredName($ignoredAnnotationName);
     }
     return self::$annotationReader;
 }
All Usage Examples Of Doctrine\Common\Annotations\AnnotationReader::addGlobalIgnoredName