Fix passing cache parameter (#17907)

This commit is contained in:
Alexander Makarov
2020-03-04 15:04:28 +03:00
committed by GitHub
parent b7723aebcf
commit 0660011f53

View File

@ -1141,7 +1141,7 @@ class Command extends Component
if (is_array($info)) { if (is_array($info)) {
/* @var $cache \yii\caching\CacheInterface */ /* @var $cache \yii\caching\CacheInterface */
$cache = $info[0]; $cache = $info[0];
$cacheKey = $this->getCacheKey($method, $fetchMode); $cacheKey = $this->getCacheKey($method, $fetchMode, '');
$result = $cache->get($cacheKey); $result = $cache->get($cacheKey);
if (is_array($result) && isset($result[0])) { if (is_array($result) && isset($result[0])) {
Yii::debug('Query result served from cache', 'yii\db\Command::query'); Yii::debug('Query result served from cache', 'yii\db\Command::query');