/**
* Stores multiple key-value pairs in cache.
* @param array $data array where key corresponds to cache key while value is the value stored
* @param integer $duration the number of seconds in which the cached values will expire. 0 means never expire.
* @return array array of failed keys. Always empty in case of using memcached.
*/
protected function setValues($data, $duration)
{
if ($this->useMemcached) {
$this->_cache->setMulti($data, $duration > 0 ? $duration + time() : 0);
return [];
} else {
return parent::setValues($data, $duration);
}
}