You are here

public function CachedReader::getClassAnnotations in Service Container 7.2

Same name and namespace in other branches
  1. 7 modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php \Doctrine\Common\Annotations\CachedReader::getClassAnnotations()

Gets the annotations applied to a class.

Parameters

\ReflectionClass $class The ReflectionClass of the class from which: the class annotations should be read.

Return value

array An array of Annotations.

Overrides Reader::getClassAnnotations

1 call to CachedReader::getClassAnnotations()
CachedReader::getClassAnnotation in modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php
Gets a class annotation.

File

modules/providers/service_container_annotation_discovery/lib/Doctrine/annotations/lib/Doctrine/Common/Annotations/CachedReader.php, line 74

Class

CachedReader
A cache aware annotation reader.

Namespace

Doctrine\Common\Annotations

Code

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;
}