Cachearium\Backend\CacheRAM::delete PHP Method

delete() public method

public delete ( CacheKey $k )
$k Cachearium\CacheKey
    public function delete(CacheKey $k)
    {
        if (!is_string($k->sub)) {
            $sub = md5(serialize($k->sub));
        } else {
            $sub = $k->sub;
        }
        $this->checkValidArgs($k);
        unset($this->storage[$this->namespace . $k->base . $k->id][$sub]);
        return true;
    }

Usage Example

示例#1
0
 /**
  * (non-PHPdoc)
  * @see \Cachearium\Backend\CacheRAM::delete()
  */
 public function delete(CacheKey $k)
 {
     // @codeCoverageIgnoreStart
     if (!$this->enabled) {
         throw new NotCachedException();
     }
     // @codeCoverageIgnoreEnd
     $group = $this->hashKey($k);
     $this->log(CacheLogEnum::DELETED, $k);
     parent::delete($k);
     return $this->memcached->delete($group);
 }