<?php
namespace Illuminate\Cache;
// a namespace
trait RetrievesMultipleKeys
{// has a name Retrieves Multiple Keys
/**
* Retrieve multiple items from the cache by key.
*
* Items not found in the cache will have a null value.
*
* @param array $keys
* @return array
*/
public function many(array $keys)// Retrieve multiple items from the cache by key.
{// items not found in the cache will have a null value.
$return = [];// a store array
foreach ($keys as $key) {
$return[$key] = $this->get($key);
}// a set get
return $return;// a return
}// get many value
/**
* Store multiple items in the cache for a given number of minutes.
*
* @param array $values
* @param int $minutes
* @return void
*/
public function putMany(array $values, $minutes)// Store multiple items in the cache for a given number of minutes.
{
foreach ($values as $key => $value) {
$this->put($key, $value, $minutes);
}
}// a big set putMany
}