Store but do not save yet
@param CacheItemInterface $item The item to store
@return bool True
504146
public function saveDeferred(CacheItemInterface $item)
    {
        $this->cache->set($item->getKey(), $item);
        return true;
    }
556074
protected function storeItemInCache(CacheItemInterface $item)
    {
        $this->cache->setRawValue(
            $this->getHierarchyKey($item->getKey()),
            $item->get(),
            $item->getTags(),
            $item->getExpirationTimestamp()
        );
    }
842976
public function setAndSaveCurrent($item = false)
    {
        $this->setCurrent($item);
        $this->savePersistCurrent($item);

        return $this;
    }
1091217
public function hasItem(Item $item, bool $initialOnly = true): bool
    {
        $list = ($initialOnly) ? $this->initialItems : $this->items;
        foreach ($list as $my_item) {
            if (0 === Item::compare($my_item, $item)) {
                return true;
            }
        }
        return false;
    }
183897
public function save(CacheItemInterface $item)
    {
        $this->cache->set($item->getKey(), $item);
        return $this->commit();
    }
222981
public function save(CacheItemInterface $item)
    {
        if (! $item instanceof CacheItem) {
            throw new InvalidArgumentException('$item must be an instance of ' . CacheItem::class);
        }

        $this->validateKey($item->getKey());

        try {
            $options = false;
            $expiration = $item->getExpiration();

            // @todo I can't see any way to set the TTL on an individual item except by temporarily overwriting the
            //       option on the storage adapter. Not sure if all storage adapters will support this...
            if ($expiration instanceof DateTime) {
                $options = $this->storage->getOptions();
                $new = clone $options;
                $interval = $expiration->diff(new DateTime(), true);
                $new->setTtl($interval->format('%s'));
                $this->storage->setOptions($new);
            }

            $saved = $this->storage->setItem($item->getKey(), $item->get());

            if ($options) {
                $this->storage->setOptions($options);
            }

        } catch (Exception\InvalidArgumentException $e) {
            throw new InvalidArgumentException($e->getMessage(), $e->getCode(), $e);

        } catch (Exception\ExceptionInterface $e) {
            throw new CacheException($e->getMessage(), $e->getCode(), $e);
        }

        return $saved;
    }
1186944
public function set(ItemInterface $item)
    {
        $id = $item->getId();
        $collectionName = $item->getCollection();

        $this->items[$id] = $item;

        if (isset($this->idCollections[$id]) && $this->idCollections[$id] !== $collectionName) {
            throw new \RuntimeException(sprintf('The item with id: "%s" has been registered previously with another collection.', $id));
        }

        if (isset($this->itemCollections[$collectionName]) === false) {
            $this->itemCollections[$collectionName] = [];
        }

        $this->itemCollections[$collectionName][$id] = $item;
        $this->idCollections[$id] = $collectionName;
    }
1089957
public function remove($item)
    {
        $key = $item instanceof Item ? $item->name : $item;

        if ($this->has($key)) {
            $this->forget($key);
            return true;
        }

        return false;
    }
844802
public function isCached(CacheItemInterface $item = null)
    {
        if (!$item) {
            $key = $this->getCurrentKey();
            $item = $this->getItemStorage()->get($key);
        }

        return $item ? true : false;
    }
182650
public function save(CacheItemInterface $item)
    {
        $item->setCacheItemPool($this);
        $key = [$this->getPoolName(), $item->getKey()];
        $key = $this->getDriver()->buildKey($key);

        $this->getDriver()->set($key, $this->phpSerialize($item->get()), $item->getExpiration());

        return $this;
    }
30298
private function saveContentInCache($item, array $content)
    {
        if (null !== $this->cache && null !== $item) {
            $item->set($this->contentCache);
            $this->cache->save($item);
        }

        return $content;
    }
256469
public function addItem(Item $item)
    {
        if (!$this->items->contains($item)) {
            $this->items->add($item);
            $item->setStorage($this);
        }

        return $this;
    }
512267
public function isAncestor(ItemInterface $item): bool
    {
        $ancestors = $this->getBreadcrumbs();
        array_pop($ancestors);

        return in_array(
            $item,
            array_map(
                function (ParentNode $node) {
                    return $node->getItem();
                },
                $ancestors
            )
        );
    }
326660
public function save(CacheItemInterface $item)
    {
        $key = $item->getKey();
        $value = $item->get();

        $fileName = $this->fetchStreamUri($key);

        $filePath = pathinfo($fileName, PATHINFO_DIRNAME);

        if (!is_dir($filePath)) {
            mkdir($filePath, 0770, true);
        }

        if ($this->denyAccess) {
            $value = $this->options['deny_code'] . $value;
        }

        $success = $this->write(
            $fileName,
            $value,
            ($this->options['file_locking'] ? LOCK_EX : null)
        );

        return $success;
    }
860340
protected function _isItemActive(array $item): bool
    {
        if (empty($item['url'])) {
            return false;
        }
        $current = $this->_currentUrl;
        if (!empty($item['url']['plugin']) && $item['url']['plugin'] != $current['plugin']) {
            return false;
        }
        if ($item['url']['controller'] == $current['controller'] && $item['url']['action'] == $current['action']) {
            $this->_controllerActive = $current['controller'];
            $this->_actionActive = $item['url']['action'];

            return true;
        }
        if (!empty($this->_actionActive) && $item['url']['controller'] == $current['controller']) {
            $this->_controllerActive = $current['controller'];

            return true;
        }

        return false;
    }
1119454
public function save(CacheItemInterface $item)
    {
        $this->create($item->getKey(), $item->get(), $item->getExpiration());

        return $this;
    }
1255226
public function add ($item) {
        if (!$this->getConnection ()->getClient ()->sadd ($this->name , $item)) {
            return false;
        }
        $this->_data = null;
        $this->_count = null;
        return true;
    }