public function set(CacheItem $item): self
    {
        $driver = $this->getDriver();
        $driver->set($item->key, $item->value, $item->ttl);
        if ($this->hasEventListeners('itemSet')) {
            $this->dispatchEvent('itemSet', new \BearFramework\App\Cache\ItemSetEventDetails(clone($item)));
        }
        if ($this->hasEventListeners('itemChange')) {
            $this->dispatchEvent('itemChange', new \BearFramework\App\Cache\ItemChangeEventDetails($item->key));
        }
        return $this;
    }
public function set(CacheItem $item): self
    {
        $driver = $this->getDriver();
        $driver->set($item->key, $item->value, $item->ttl);
        if ($this->hasEventListeners('itemSet')) {
            $this->dispatchEvent('itemSet', new \BearFramework\App\Cache\ItemSetEventDetails(clone($item)));
        }
        if ($this->hasEventListeners('itemChange')) {
            $this->dispatchEvent('itemChange', new \BearFramework\App\Cache\ItemChangeEventDetails($item->key));
        }
        return $this;
    }
public function set ( CacheItem $ item ) : self { $ driver = $ this -> getDriver ( ) ; $ driver -> set ( $ item -> key , $ item -> value , $ item -> ttl ) ; if ( $ this -> hasEventListeners ( 'itemSet' ) ) { $ this -> dispatchEvent ( 'itemSet' , new \ BearFramework \ App \ Cache \ ItemSetEventDetails ( clone ( $ item ) ) ) ; } if ( $ this -> hasEventListeners ( 'itemChange' ) ) { $ this -> dispatchEvent ( 'itemChange' , new \ BearFramework \ App \ Cache \ ItemChangeEventDetails ( $ item -> key ) ) ; } return $ this ; }
Stores a cache item.

@param \BearFramework\App\CacheItem $item The cache item to store.
@return self Returns a reference to itself.
Stores a cache item .