MatthiasMullie\Scrapbook\Buffered\Utils\Defer::delete PHP Метод

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

public delete ( string $key )
$key string
    public function delete($key)
    {
        $args = array('key' => $key);
        $this->keys[$key] = array(__FUNCTION__, array($this->cache, __FUNCTION__), $args);
    }

Usage Example

Пример #1
0
 /**
  * {@inheritdoc}
  */
 public function delete($key)
 {
     // check the current value to see if it currently exists, so we can
     // properly return true/false as would be expected from KeyValueStore
     $value = $this->get($key);
     if ($value === false) {
         return false;
     }
     /*
      * To make sure that subsequent get() calls for this key don't return
      * a value (it's supposed to be deleted), we'll make it expired in our
      * temporary bag (as opposed to deleting it from out bag, in which case
      * we'd fall back to fetching it from real store, where the transaction
      * might not yet be committed)
      */
     $this->local->set($key, $value, -1);
     $this->defer->delete($key);
     return true;
 }