Uses the supplied doctrine cache to store the parsed queries.

@param DoctrineCacheProvider $cache The doctrine cache

@return void
488689
public static function setDoctrineCache(DoctrineCacheProvider $cache)
    {
        self::$cacheImplementation = new DoctrineCache($cache);
        self::$hasBeenCleared      = false;
    }
41732
protected function importSchema(array $cache)
    {
        list($this->hasIncludes, $this->declarations, $this->functions, $this->namespaces) = $cache;
    }
702571
private function createQuery($cache = false)
    {
        $q           = '';
        $i           = 0;
        $uniqueArray = [];

        foreach ($this->fields as $field) {
            if (in_array($field->identifier(), $uniqueArray)) {
                $q .= ',' . $field->table() . '.' . $field->identifier() . ' AS ' . $field->table() . ucfirst($field->identifier());
            } else {
                if ($i > 0) {
                    $q .= ',' . $field->table() . '.' . $field->identifier();
                } else {
                    $q .= 'SELECT ' . $field->table() . '.' . $field->identifier();
                }
            }

            $uniqueArray[] = $field->identifier();
            $i++;
        }

        $q .= ' FROM ' . $this->table();

        if (!$cache) {
            foreach ($this->getJoins() as $joinKey => $joinValue) {
                $q .= $joinValue;
            }
        }

        $this->setQuery($q);
    }
775261
public function setCache(FrontendInterface $cache)
    {
        parent::setCache($cache);

        $pathHash = substr(md5($this->environmentConfiguration->getApplicationIdentifier() . $cache->getIdentifier()), 0, 12);
        $this->identifierPrefix = 'Flow_' . $pathHash . '_';
    }
1254999
public function load(Cache $cache, $cacheId)
    {
        if ($cache->contains($cacheId)) {

            /**
             * Cache contains gearman structure
             */
            $this->workerCollection = $cache->fetch($cacheId);

        } else {

            /**
             * Cache is empty.
             *
             * Full structure must be generated and cached
             */
            $this->workerCollection = $this
                ->getGearmanParser()
                ->load()
                ->toArray();

            $cache->save($cacheId, $this->workerCollection);
        }

        return $this;
    }
11513
protected function setDefaultMetadataCache($cache, ServiceLocatorInterface $serviceLocator)
    {
        $metadataCache = null;

        if (is_string($cache)) {
            if ($serviceLocator->has($cache)) {
                $metadataCache = $serviceLocator->get($cache);
            }
        } else if ($cache instanceof Zend_Cache_Core) {
            $metadataCache = $cache;
        }

        if ($metadataCache instanceof Zend_Cache_Core) {
            Zend_Db_Table::setDefaultMetadataCache($metadataCache);
        }

    }
504306
public function set_cache_layer($cache) {
        if (!method_exists($cache, 'set') || !method_exists($cache, 'get')) {
            throw new \Exception("Invalid cache layer - must have set and get.");
        }

        $this->_cache = $cache;
    }
1317017
public function setCaching($caching) {
    $this->view->caching = $caching ? \Smarty::CACHING_LIFETIME_CURRENT : \Smarty::CACHING_OFF;
  }
469528
private static function setCache(Cache &$cacheToChange = null, Cache $cache = null, $namespace = null)
    {
        if ($namespace === null) {
            $namespace = self::$cacheDefaultNamespace;
        }
        if (!is_string($namespace)) {
            throw new \InvalidArgumentException("The namespace must be a string.");
        }

        $cacheToChange = $cache;
        if ($cache !== null) {
            $cacheToChange->setNamespace($namespace);
        }
    }
401782
public function setStatusCache(StringFrontend $cache)
    {
        $this->statusCache = $cache;
        $backend = $this->statusCache->getBackend();
        if (is_callable(['initializeObject', $backend])) {
            $backend->initializeObject();
        }
    }
1024316
public static function setArrayAccessCache(\ArrayAccess $cache)
    {
        self::$cacheImplementation = new ArrayAccessCacheAdapter($cache);
        self::$hasBeenCleared      = false;
    }
1128222
protected static function _cache($entity)
    {
        static $cache;

        if (!$cache) {
            $cache = new AnObjectArray();
        }

        if (!isset($cache[$entity->getRepository()])) {
            $cache[$entity->getRepository()] = new ArrayObject();
        }

        return $cache[$entity->getRepository()];
    }
504215
public function handle(Repository $cache, GraphQL $graphQL): void
    {
        // Clear the cache so this always validates the current schema
        $cache->forget(config('lighthouse.cache.key'));

        $graphQL->prepSchema()->assertValid();

        $this->info('The defined schema is valid.');
    }
1056528
protected function _afterRepositoryFetch(AnCommandContext $context)
    {
        if ($this->_enable) {
            $key = $this->_getCacheKey($context->query);
            self::$_cache->offsetSet($key, $context->data);
        }
    }
443796
public function getCache($cache)
    {
        $cache = self::encodeCache($cache);
        $url = "projects/{$this->project_id}/caches/$cache";
        $this->setJsonHeaders();
        return self::json_decode($this->apiCall(self::GET, $url));
    }
935634
function cache($query, $result) {
        if ($this->isSelectStatement($query) === TRUE) $this->queries[$query] = $result;
        else return(FALSE);
        return(TRUE);
    }
482831
protected function pruneCache($cache)
    {
        if (count($this->cache[$cache]) == $this->maxCacheSize) {
            $this->cache[$cache] = array_slice($this->cache[$cache], $this->maxCacheSize * 0.2);
        }
    }