deleteMulti() публичный Метод

Return value will be an associative array in [key => status] form, where status is a boolean true for success, or false for failure.
public deleteMulti ( array $keys ) : bool[]
$keys array
Результат bool[]
Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function deleteItems(array $keys)
 {
     foreach ($keys as $key) {
         $this->assertValidKey($key);
         unset($this->deferred[$key]);
     }
     $success = $this->store->deleteMulti($keys);
     return !in_array(false, $success);
 }
Пример #2
0
 /**
  * {@inheritdoc}
  */
 public function deleteItems(array $keys)
 {
     foreach ($keys as $key) {
         $this->assertValidKey($key);
         unset($this->deferred[$key]);
     }
     $this->store->deleteMulti($keys);
     // as long as the item is gone from the cache (even if it never existed
     // and delete failed because of that), we should return `true`
     return true;
 }
Пример #3
0
 /**
  * {@inheritdoc}
  */
 public function deleteMultiple($keys)
 {
     if ($keys instanceof Traversable) {
         $keys = iterator_to_array($keys);
     }
     if (!is_array($keys) || array_filter($keys, 'is_string') !== $keys) {
         throw new InvalidArgumentException('Invalid keys: ' . serialize($keys) . '. Must be array of strings.');
     }
     $success = $this->store->deleteMulti($keys);
     return !in_array(false, $success);
 }
Пример #4
0
 /**
  * {@inheritdoc}
  */
 public function deleteMulti(array $keys)
 {
     return $this->cache->deleteMulti($keys);
 }