Return cache

@param string $query
@return null|mixed
356094
protected function get_cache($query){
        return isset($this->query_cache[$query]) ? $this->query_cache[$query] : null;
    }
597019
public function setEagerLoaded($query)
	{
		if( ! empty($this->getEagerLoad()))
		{
			$query = $query->with($this->getEagerLoad());
		}

		return $query;
	}
706224
public function get(string $uri, string $query = '')
    {

        $path = $this->buildRelativePath($this->safePath($uri), $query);
        $cache_file_path = $path . $this->results_filename;

        // If we cant read from the cache, then just return false.
        if (! is_readable($cache_file_path))
            return false;

        // Get the data from the file and unserialize it
        $file = unserialize(file_get_contents($cache_file_path));

        // If the cached entry is expired and does not have any ETag, remove it.
        if ($file->expired() && ! $file->hasHeader('ETag')) {

            $this->forget($uri, $query);

            return false;
        }

        return $file;
    }
1334384
public static function getRow($query)
    {
        $ret = null;

        $res = self::query($query);
        if ($res) {
            if ($row = self::connection()->sql_fetch_assoc($res)) {
                $ret = $row;
            }
            self::free($res);
        }

        return $ret;
    }
549293
final protected function execute($query, $ignore_cache = false){
        if( $this->cache_exist($query) && !$ignore_cache ){
            return $this->get_cache($query);
        }else{
            $result = $this->db->query($query);
            $this->clear();
            $this->cache_query($query, $result);
            return $result;
        }
    }
502401
public function query($query)
    {
        // If the query is empty, we'll return false
        if ($query === null || empty($query)) {
            return false;
        }

        if ($this->read) {
            // If read is true, we'll perform a read search, retrieving one record
            $results = $this->connection->read($this->getDn(), $query, $this->getSelects());
        } elseif ($this->recursive) {
            // If recursive is true, we'll perform a recursive search
            $results = $this->connection->search($this->getDn(), $query, $this->getSelects());
        } else {
            // Read and recursive is false, we'll return a listing
            $results = $this->connection->listing($this->getDn(), $query, $this->getSelects());
        }

        if ($results) {
            return $this->processResults($results);
        }

        return false;
    }
1073655
public function get(string $key)
    {
        if ($this->enabled === false) {
            return null;
        }

        $index = $this->cacheIndex[$key] ?? $key;
        if (!isset($this->cache[$index]) || $this->cacheExpiryTime[$index] < microtime(true)) {
            return null;
        }

        ++$this->cacheAccessCount[$index];

        return $this->cache[$index];
    }
536548
public function get(string $uri, string $query = '')
    {

        $value = $this->memcached->get($this->buildCacheKey($uri, $query));
        if ($value === false)
            return false;

        $data = unserialize($value);

        // If the cached entry is expired and does not have any ETag, remove it.
        if ($data->expired() && ! $data->hasHeader('ETag')) {
            $this->forget($uri, $query);

            return false;
        }

        return $data;
    }
895092
public function process(QueryInterface $query)
    {
        if (!$query->isType(QueryInterface::TYPE_USE)) {
            return null;
        }

        $query = new UseQuery($query);
        $keyspace = $query->getDbName();
        $this->dsn->getConfig()->setKeyspace($keyspace);

        if ($this->client instanceof CachingClient) {
            $this->client->clearCache();
        }

        return new EmptyResult();
    }
1359208
public function get(string $uri, string $query = '')
    {

        if (! $this->has($uri, $query))
            return false;

        $data = unserialize($this->redis
            ->get($this->buildCacheKey($uri, $query)));

        // If the cached entry is expired and does not have any ETag, remove it.
        if ($data->expired() && ! $data->hasHeader('ETag')) {

            $this->forget($uri, $query);

            return false;
        }

        return $data;
    }
1147758
public function getCache($key)
    {
        if ($this->sqlInitialized()) {
            if ($this->sql) {
                $_key = $this->sql->real_escape_string($key);
                if ($this->lifetime == self::IMMORTAL_LIFETIME) {
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND
                                `expire` IS NULL
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                } else {
                    $liveCache = date('Y-m-d H:i:s', time() - $this->lifetime);
                    if ($response = $this->sql->query("
                        SELECT *
                            FROM `{$this->table}`
                            WHERE
                                `{$this->key}` = '$_key' AND (
                                    (
                                        `timestamp` > '{$liveCache}' AND
                                        `expire` IS NULL
                                    ) OR (
                                        `expire` > NOW()
                                    )
                                )
                    ")) {
                        if ($cache = $response->fetch_assoc()) {
                            return unserialize($cache[$this->cache]);
                        }
                    }
                }
            }
            return false;
        }
    }
134501
public function parse($query=null)
    {
        $this->checkQuery($query);
        
        return $this->getDb()->setQuery($this->getQuery())->parse();
    }
461650
public function search($query) {
        global $CFG, $DB;
        if ($result = parent::search($query)) {
            return $result;
        }

        $found = false;
        if ($processors = get_message_processors()) {
            foreach ($processors as $processor) {
                if (!$processor->available) {
                    continue;
                }
                if (strpos($processor->name, $query) !== false) {
                    $found = true;
                    break;
                }
                $strprocessorname = get_string('pluginname', 'message_'.$processor->name);
                if (strpos(core_text::strtolower($strprocessorname), $query) !== false) {
                    $found = true;
                    break;
                }
            }
        }
        if ($found) {
            $result = new stdClass();
            $result->page     = $this;
            $result->settings = array();
            return array($this->name => $result);
        } else {
            return array();
        }
    }
515996
public function search($query)
  {
    $content = $query->getBridgeJson($this->clientKey);

    return $this->query($this->bridgeUrl, $content, self::RESULTS_CLASS);
  }
691244
function getCache( $key ) {

        return isset( $this->_cache[ $key ] ) ? $this->_cache[ $key ] : null;

    }
1336925
public function getValue($query)
    {
        $nodes = $this->xpath->query($this->root.'/'.$query);
        if ($nodes->length > 0) {
            return $nodes->item(0)->nodeValue;
        }

        return null;
    }
671029
public function setQuery($query)
    {
        $this->cacheRows = null;
        $this->size = null;
        $this->paginator = new Paginator($query);

        return $this;
    }