public function getPropertyNamesByAnnotation($className, $annotationClassName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES])) {
            return [];
        }

        $propertyNames = [];
        foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] as $propertyName => $propertyData) {
            if (isset($propertyData[self::DATA_PROPERTY_ANNOTATIONS][$annotationClassName])) {
                $propertyNames[$propertyName] = true;
            }
        }

        return array_keys($propertyNames);
    }
public function getPropertyNamesByAnnotation($className, $annotationClassName)
    {
        $className = $this->prepareClassReflectionForUsage($className);
        if (!isset($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES])) {
            return [];
        }

        $propertyNames = [];
        foreach ($this->classReflectionData[$className][self::DATA_CLASS_PROPERTIES] as $propertyName => $propertyData) {
            if (isset($propertyData[self::DATA_PROPERTY_ANNOTATIONS][$annotationClassName])) {
                $propertyNames[$propertyName] = true;
            }
        }

        return array_keys($propertyNames);
    }
public function getPropertyNamesByAnnotation ( $ className , $ annotationClassName ) { $ className = $ this -> prepareClassReflectionForUsage ( $ className ) ; if ( ! isset ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] ) ) { return [ ] ; } $ propertyNames = [ ] ; foreach ( $ this -> classReflectionData [ $ className ] [ self :: DATA_CLASS_PROPERTIES ] as $ propertyName => $ propertyData ) { if ( isset ( $ propertyData [ self :: DATA_PROPERTY_ANNOTATIONS ] [ $ annotationClassName ] ) ) { $ propertyNames [ $ propertyName ] = true ; } } return array_keys ( $ propertyNames ) ; }
Searches for and returns all names of class properties which are marked by the
specified annotation. If no properties were found, an empty array is returned.

@param string $className Name of the class containing the properties
@param string $annotationClassName Class name of the annotation to search for
@return array An array of property names carrying the annotation
@api
Searches for and returns all names of class properties which are marked by the specified annotation . If no properties were found an empty array is returned .