delete() public method

Returns true if item existed & was successfully deleted, false otherwise. Return value is a boolean true when the operation succeeds, or false on failure.
public delete ( string $key ) : boolean
$key string
return boolean
Esempio n. 1
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     if (!is_string($key)) {
         throw new InvalidArgumentException('Invalid key: ' . serialize($key) . '. Must be string.');
     }
     return $this->store->delete($key);
 }
Esempio n. 2
0
 /**
  * {@inheritdoc}
  */
 public function deleteItem($key)
 {
     $this->assertValidKey($key);
     $this->store->delete($key);
     unset($this->deferred[$key]);
     // 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;
 }
Esempio n. 3
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     return $this->cache->delete($key);
 }
Esempio n. 4
0
 /**
  * {@inheritdoc}
  */
 public function deleteItem($key)
 {
     $this->assertValidKey($key);
     return $this->store->delete($key);
 }