Neos\Flow\Reflection\ReflectionService::getClassAnnotation PHP Метод

getClassAnnotation() публичный Метод

If multiple annotations are set on the target you will get one (random) instance of them.
public getClassAnnotation ( string $className, string $annotationClassName ) : object
$className string Name of the class
$annotationClassName string Annotation to filter for
Результат object
    public function getClassAnnotation($className, $annotationClassName)
    {
        if (!$this->initialized) {
            $this->initialize();
        }
        $annotations = $this->getClassAnnotations($className, $annotationClassName);
        return $annotations === [] ? null : current($annotations);
    }

Usage Example

 /**
  * Checks if the specified class and method matches against the filter
  *
  * @param string $className Name of the class to check against
  * @param string $methodName Name of the method to check against
  * @param string $methodDeclaringClassName Name of the class the method was originally declared in
  * @param mixed $pointcutQueryIdentifier Some identifier for this query - must at least differ from a previous identifier. Used for circular reference detection.
  * @return boolean true if the class / method match, otherwise false
  */
 public function matches($className, $methodName, $methodDeclaringClassName, $pointcutQueryIdentifier)
 {
     $valueObjectAnnotation = $this->reflectionService->getClassAnnotation($className, Flow\ValueObject::class);
     if ($valueObjectAnnotation !== null && $valueObjectAnnotation->embedded === true) {
         return true;
     }
     return false;
 }
All Usage Examples Of Neos\Flow\Reflection\ReflectionService::getClassAnnotation
ReflectionService