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[] |
/** * {@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); }
/** * {@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; }
/** * {@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); }
/** * {@inheritdoc} */ public function deleteMulti(array $keys) { return $this->cache->deleteMulti($keys); }