Esempio n. 1
0
 public function getMulti($keys)
 {
     $result = new MultiGetResult($keys);
     foreach ($keys as $key => $id) {
         $result->miss($id, $key);
     }
 }
Esempio n. 2
0
 public function getMulti($keys)
 {
     $result = new MultiGetResult($keys);
     foreach ($keys as $key => $id) {
         try {
             $result->hit($key, $this->get($key));
         } catch (CacheMissException $ex) {
             $result->miss($id, $key);
         }
     }
     return $result;
 }
Esempio n. 3
0
 public function getMulti($keys)
 {
     $result = new MultiGetResult($keys);
     $null = null;
     $cached = $this->memcached->getMulti(array_keys($keys), $null, \Memcached::GET_PRESERVE_ORDER);
     foreach ($cached as $key => $value) {
         if (null === $value) {
             $id = $keys[$key];
             $result->miss($id, $key);
         } else {
             $result->hit($key, $value);
         }
     }
     return $result;
 }