LdapTools\Cache\StashCache::set PHP Method

set() public method

public set ( LdapTools\Cache\CacheableItemInterface $cacheableItem )
$cacheableItem LdapTools\Cache\CacheableItemInterface
    public function set(CacheableItemInterface $cacheableItem)
    {
        $item = $this->getCacheItem($cacheableItem->getCacheType(), $cacheableItem->getCacheName());
        $data = $item->get();
        if ($item->isMiss()) {
            $item->lock();
            $this->getPool()->save($item->set($cacheableItem));
        } else {
            $cacheableItem = $data;
        }
        return $cacheableItem;
    }