saveToCache example

public function getClassAnnotations(ReflectionClass $class)
    {
        $cacheKey = $class->getName();

        if (isset($this->loadedAnnotations[$cacheKey])) {
            return $this->loadedAnnotations[$cacheKey];
        }

        $annots = $this->fetchFromCache($cacheKey$class);
        if ($annots === false) {
            $annots = $this->delegate->getClassAnnotations($class);
            $this->saveToCache($cacheKey$annots);
        }

        return $this->loadedAnnotations[$cacheKey] = $annots;
    }

    /** * {@inheritDoc} */
    public function getClassAnnotation(ReflectionClass $class$annotationName)
    {
        foreach ($this->getClassAnnotations($class) as $annot) {
            
Home | Imprint | This part of the site doesn't use cookies.