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
Ejemplo 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);
 }
Ejemplo 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;
 }
Ejemplo n.º 3
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     return $this->cache->delete($key);
 }
Ejemplo n.º 4
0
 /**
  * {@inheritdoc}
  */
 public function deleteItem($key)
 {
     $this->assertValidKey($key);
     return $this->store->delete($key);
 }