Doctrine\Common\Annotations\CachedReader::getClassAnnotations PHP Method

getClassAnnotations() public method

{@inheritDoc}
public getClassAnnotations ( ReflectionClass $class )
$class ReflectionClass
    public function getClassAnnotations(ReflectionClass $class)
    {
        $cacheKey = $class->getName();
        if (isset($this->loadedAnnotations[$cacheKey])) {
            return $this->loadedAnnotations[$cacheKey];
        }
        if (false === ($annots = $this->fetchFromCache($cacheKey, $class))) {
            $annots = $this->delegate->getClassAnnotations($class);
            $this->saveToCache($cacheKey, $annots);
        }
        return $this->loadedAnnotations[$cacheKey] = $annots;
    }

Usage Example

Beispiel #1
0
 /**
  * Annotations specifically related to Entity Transformation as defined in the TransformMapping class
  *
  * @param $class
  * @return null | TransformMapping
  */
 public function getTransformAnnotations($class)
 {
     $annotations = $this->reader->getClassAnnotations(new \ReflectionClass($class));
     foreach ($annotations as $annotation) {
         if ($annotation instanceof TransformMapping) {
             return $annotation;
         }
     }
     return null;
 }
All Usage Examples Of Doctrine\Common\Annotations\CachedReader::getClassAnnotations