Checks if a cache entry with the specified identifier exists.

@param string $entryIdentifier An identifier specifying the cache entry
@return boolean true if such an entry exists, false if not
@throws Exception
@throws FilesException
@api
762479
public function has(string $entryIdentifier): bool
    {
        $this->connect();

        $statementHandle = $this->databaseHandle->prepare('SELECT COUNT("identifier") FROM "' . $this->cacheTableName . '" WHERE "identifier"=? AND "context"=? AND "cache"=?' . $this->getNotExpiredStatement());
        $statementHandle->execute([$entryIdentifier, $this->context(), $this->cacheIdentifier]);
        return ($statementHandle->fetchColumn() > 0);
    }
502691
public static function doEscapeIdentifier($Identifier, $instance=null) {
		self::prepareInstance($instance);
		return self::$instances[$instance]->escapeIdentifier($Identifier);
	}
924818
public static function update_site_identifier($siteidentifier) {
        global $CFG;
        // Include locallib.
        require_once($CFG->dirroot.'/cache/locallib.php');
        $factory = cache_factory::instance();
        $factory->updating_started();
        $config = $factory->create_config_instance(true);
        $siteidentifier = $config->update_site_identifier($siteidentifier);
        $factory->updating_finished();
        cache_factory::reset();
        return $siteidentifier;
    }
1276454
public static function has($identifier)
    {
        try {
            $objIdentifier = self::getIdentifier($identifier);
            $strIdentifier = (string) $objIdentifier;
            $result = (bool) self::$_services->offsetExists($strIdentifier);
        } catch (AnServiceIdentifierException $e) {
            $result = false;
        }

        return $result;
    }
533707
public function generate(string $entryIdentifier, string $fileName, string $data)
    {
        $contentGzip = \gzencode($data, $this->getCompressionLevel());
        if ($contentGzip) {
            GeneralUtility::writeFile($fileName . '.gz', $contentGzip);
        }
    }
270235
private function isCacheable($resultIdentifier)
    {
        return $this->getServiceProxy()->getDeliveryExecution($resultIdentifier)->getState()->getUri() == DeliveryExecutionInterface::STATE_FINISHIED;
    }
1037986
public function hasIdentifier($identifier)
    {
        if(!$identifier instanceof ObjectIdentifierInterface) {
            $identifier = $this->getIdentifier($identifier);
        }

        return in_array((string) $identifier, $this->__identifier_list);
    }
1123302
public function requireOnce(string $entryIdentifier)
    {
        $value = trim($this->get($entryIdentifier));
        if ($value === '') {
            return false;
        }
        if (isset($this->_requiredEntryIdentifiers[$entryIdentifier])) {
            return false;
        }
        $this->_requiredEntryIdentifiers[$entryIdentifier] = true;
        return include('data:text/plain;base64,' . base64_encode($value));
    }
613666
protected function cacheRemoteUri(string $entryIdentifier, int $lifetime = 3600, array $tags = [])
    {
        $result = $this->cacheViaTrait($entryIdentifier, function () {
        }, 'remote_file', $lifetime, $tags);
        if (null === $result) {
            // call two times, because the anonym function is not the real result.
            // The result is output by the get method of the remote_file backend.
            $result = $this->cacheViaTrait($entryIdentifier, function () {
            }, 'remote_file', $lifetime, $tags);
        }

        return $result;
    }
501721
public function hasCache(string $identifier): bool
    {
        return isset($this->caches[$identifier]) || isset($this->cacheConfigurations[$identifier]);
    }
578750
public function has($identifier): bool
    {
        foreach ($this->queue as $item) {
            if ($item->getMessage()->getIdentifier() === $identifier) {
                return true;
            }
        }

        return false;
    }
625126
public function generate(string $entryIdentifier, string $fileName, string $data)
    {
        GeneralUtility::writeFile($fileName, $data);
    }
387349
protected function createParsedIdentifier(SchemaIdentifierInterface $identifier): ParserIdentifierInterface
    {
        return $this->factory->createParsedIdentifier($this->position, $identifier);
    }
670285
public function loadIdentifier($identifier)
    {
        $result = false;

        $identifier = AnService::getIdentifier($identifier);

        //Get the path
        $path = $identifier->filepath;

        if ($path !== false) {
            $result = self::loadFile($path);
        }

        return $result;
    }
730886
public static function has($identifier)
    {
        list($hash, $keys) = self::_parseIdentifier($identifier);

        foreach ($keys as $key) {
            if (isset($GLOBALS['_'.$hash]) && array_key_exists($key, $GLOBALS['_'.$hash])) {
                return true;
            }
        }

        return false;
    }
1329006
public function has($entryIdentifier)
    {
        $folder = GeneralUtility::getFileAbsFileName(self::RELATIVE_STORAGE_FOLDER);
        $fileName = $this->getFileName($entryIdentifier);
        if (!\is_file($folder . $fileName)) {
            return false;
        }
        if ($this->freeze) {
            return true;
        }
        $validUntil = (int)\file_get_contents($folder . $fileName . self::FILE_EXTENSION_LIFETIME);

        return $validUntil > \time();
    }
821685
public function containsResourceIdentifier($resourceIdentifier)
    {
        // This will be very slow however the base implementation can do nothing else.
        // Inheritors of this class should override this if they can do this faster!
        $items = $this->getItems(0, false);

        foreach ($items[0] as $item) {
            if ($item->_id = $resourceIdentifier) {
                return true;
            }
        }

        return false;
    }