* @package generis */ trait MultipleCacheTrait { public function deleteMultiple($keys) { $success = true; foreach ($keys as $key) { $success = $this->delete($key) && $success; } return $success; } public function getMultiple($keys, $default = null) { $values = []; foreach ($keys as $key) { $values[$key] = $this->get($key, $default); } return $values; } public function setMultiple($values, $ttl = null) { $success = true; foreach ($values as $key => $value) { $success = $this->set($key, $value, $ttl) && $success; } return $success; } }