protected function getValue($key)
{
$query = new Query();
$query->select(['data'])->from($this->cacheTable)->where('[[id]] = :id AND ([[expire]] = 0 OR [[expire]] >' . time() . ')', [':id' => $key]);
if ($this->db->enableQueryCache) {
// temporarily disable and re-enable query caching
$this->db->enableQueryCache = false;
$result = $query->createCommand($this->db)->queryScalar();
$this->db->enableQueryCache = true;
return $result;
} else {
return $query->createCommand($this->db)->queryScalar();
}
}