예제 #1
0
 /**
  * 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)
 {
     $normalizedKeys = [];
     foreach ($keys as $key => $value) {
         $normalizedKeys[] = is_string($key) ? $key : $value;
     }
     $values = $this->store->many($normalizedKeys);
     foreach ($values as $key => &$value) {
         if (is_null($value)) {
             $this->fireCacheEvent('missed', [$key]);
             $value = isset($keys[$key]) ? value($keys[$key]) : null;
         } else {
             $this->fireCacheEvent('hit', [$key, $value]);
         }
     }
     return $values;
 }