Retrieves the data from the database

@param string $key The key to retrieve

@return array An array containing 'key', 'value', and 'expire' keys
979199
protected function getData($key)
    {
        $query  = $this->db->query("SELECT value FROM cache WHERE key='" . $this->key($key) . "' AND expire >= datetime('now')");
        return $query->fetch();
    }
192559
protected function getData($key)
    {
        return $this->getCacheItem(self::CACHE_DATA, $key, function () {
            $result = $this->getContext()->invokeApiGet('POP', [
                'domain' => $this->getDomainName(),
                'action' => 'full_list',
            ]);
            return \GuzzleHttp\Psr7\parse_query($result[$this->getPrefix()]);
        });
    }
51700
protected function retrieve($key)
    {
        $sth = $this->pdo->prepare(
            'SELECT * FROM pimf_cache WHERE key = :key'
        );

        $sth->bindValue(':key', $this->key . $key);
        $sth->execute();

        $cache = $sth->fetchObject();

        if ($cache instanceof \stdClass) {

            if (time() >= $cache->expiration) {
                return $this->forget($key);
            }

            return unserialize($cache->value);
        }

        return null;
    }
791976
public function get($key) {
		// First, check to see if the result has been cached.
		if (!isset($this->_cache[$key])) {
			return FALSE;
		}

		// Second, check its freshness.
		if ($this->_cache[$key]['time'] < time() - self::$_lifespan) {
			return FALSE;
		}

		return $this->_cache[$key]['data'];
	}
391906
public function get($key)
	{
		$path = $this->path($key);

		// If the file doesn't exists, we obviously can't return the cache so we will
		// just return null. Otherwise, we'll get the contents of the file and get
		// the expiration UNIX timestamps from the start of the file's contents.
		if ( ! $this->files->exists($path))
		{
			return null;
		}

		try
		{
			$expire = substr($contents = $this->files->get($path), 0, 10);
		}
		catch (\Exception $e)
		{
			return null;
		}

		// If the current time is greater than expiration timestamps we will delete
		// the file and return null. This helps clean up the old files and keeps
		// this directory much cleaner for us as old files aren't hanging out.
		if (time() >= $expire)
		{
			return $this->forget($key);
		}

		return unserialize(substr($contents, 10));
	}
338644
public function offsetGet($key)
    {
        $key = "$key";
        if (array_key_exists($key, $this->data)) {
            return $this->data[$key];
        }

        return [];
    }
941569
public function getValue(string $key)
    {
        if (!Config::get('activateDbCache')) {
            return false;
        }

        // clean expired values at first (self-purification)
        $this->database->prepare('DELETE FROM tl_db_cache WHERE expiration < ?')->execute(time());

        $result = $this->database->prepare('SELECT * FROM tl_db_cache WHERE cacheKey = ?')->execute($key);

        if ($result->numRows > 0) {
            return $result->cacheValue;
        }

        return false;
    }
685828
public function getExpiry($key)
    {
        $key = $this->getPrefix().$key;
        if (!$this->isInCache($key)) {
            return false;
        }

        return $this->fetchExpirationFromCache($key);
    }
1124951
public function fetch($key)
    {

        if (!\array_key_exists($key, $this->hash)) {
            return false;
        }

        $data = $this->hash[$key];

        //check to see if it expired
        if ($data && ($data[0] == 0 || \time() <= $data[0])) {
            return $data[1];
        } else {
            $this->delete($key);
            return false;
        }
    }
207397
function get($key)
    {
        if (!array_key_exists($key, $this->cache)) {
            return $this->read_record($key);
        }

        return $this->cache[$key];
    }
913825
protected function fetch(string $key)
    {
        if (!isset($this->data[$key])) {
            return;
        }

        // Reset timer if there was an expiration.
        if (isset($this->timers[$key])) {
            $this->timers[$key]->again();
        }

        return $this->data[$key];
    }
1280790
public function getValueStored($key)
    {
        if (isset($this->storedValues[$key])) {
            return $this->storedValues[$key];
        } else {
            return null;
        }
    }
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;
        }
    }
692182
public function getArray($key = null) {
        if (!is_null($key)) {
            return $this->getDeepValue($key);
        } else {
            return $this->_data;
        }
    }
705971
protected function getPayload($key)
	{
		$path = $this->path($key);

		// If the file doesn't exists, we obviously can't return the cache so we will
		// just return null. Otherwise, we'll get the contents of the file and get
		// the expiration UNIX timestamps from the start of the file's contents.
		try
		{
			$expire = substr($contents = $this->files->get($path), 0, 10);
		}
		catch (Exception $e)
		{
			return array('data' => null, 'time' => null);
		}

		// If the current time is greater than expiration timestamps we will delete
		// the file and return null. This helps clean up the old files and keeps
		// this directory much cleaner for us as old files aren't hanging out.
		if (time() >= $expire)
		{
			$this->forget($key);

			return array('data' => null, 'time' => null);
		}

		$data = unserialize(substr($contents, 10));

		// Next, we'll extract the number of minutes that are remaining for a cache
		// so that we can properly retain the time for things like the increment
		// operation that may be performed on the cache. We'll round this out.
		$time = ceil(($expire - time()) / 60);

		return compact('data', 'time');
	}
757927
public function get($key)
    {
        $filename = $this->_filename($key);
        if (!file_exists($filename)) {
            return false;
        }

        $tmp_value = file_get_contents($filename);
        $expire    = (int) substr($tmp_value, 13, 24);

        // echo time()."<br />\n";
        // echo $expire."<br />\n";
        // echo substr($tmp_value,23);exit;

        if ($expire != 0 && time() < $expire) {
            return unserialize(substr($tmp_value, 23));
        } else {
            return false;
        }
    }
1014666
protected function getItem($key)
    {
        $cache_file = $this->path($key);
        if (!file_exists($cache_file) || !is_readable($cache_file)) {
            return false;
        }

        $cache_data = file_get_contents($cache_file);
        if (empty($cache_data)) {
            return false;
        }
        $cache_data = json_decode($cache_data, true);
        if ($cache_data) {
            $check_expire = $this->checkExpire($cache_data);
            if ($check_expire === false) {
                $this->delete($key);
                return false;
            }
        }

        return $cache_data;
    }