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());
}
}