Prado\Caching\TDbCache::getValue PHP Method

getValue() protected method

This is the implementation of the method declared in the parent class.
protected getValue ( $key ) : string
return string the value stored in cache, false if the value is not in the cache or expired.
    protected function getValue($key)
    {
        if (!$this->_cacheInitialized) {
            $this->initializeCache();
        }
        try {
            $sql = 'SELECT value FROM ' . $this->_cacheTable . ' WHERE itemkey=\'' . $key . '\' AND (expire=0 OR expire>' . time() . ') ORDER BY expire DESC';
            $command = $this->getDbConnection()->createCommand($sql);
            return unserialize($command->queryScalar());
        } catch (\Exception $e) {
            $this->initializeCache(true);
            return unserialize($command->queryScalar());
        }
    }