@param ItemInterface $item

@return bool

@throws NoCurrentItemFoundException
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
            )
        );
    }
136458
public function add(ItemInterface $item)
    {
        $item->setCollection($this);
        $this->items[] = $item;

        return $this;
    }
807195
public function isSatisfiedBy($item): bool
    {
        if (!$item instanceof Content) {
            throw new InvalidArgumentException($item, sprintf('Must be instance of %s', Content::class));
        }

        $relations = $this->contentService->loadRelations($item->versionInfo);

        foreach ($relations as $relation) {
            if (Relation::ASSET === $relation->type) {
                $relationsFromAssetSide = $this->contentService->loadReverseRelations($relation->destinationContentInfo);

                if (count($relationsFromAssetSide) > 1) {
                    return false;
                }
            }
        }

        return true;
    }
695170
public function addLayout(ItemInterface $item)
    {
        if ($this->hasLayout($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous layout item exists with the same id: "%s".', $item->getId()));
        }

        $this->layouts[$item->getId()] = $item;
    }
65138
public final function saveDeferred(CacheItemInterface $item)
   {
        if (in_array($item, $this->queue)) {
            return false;
        }
        $this->queue[] = $item;
        return true;
   }
995716
public function save(CacheItemInterface $item)
    {
        $this->connect();

        $ttl = $this->ttl;

        $this->driver->set($item->getKey(), $item->get(), $ttl);

        return (bool) ($this->driver->getResultCode() == \Memcached::RES_SUCCESS);
    }
476533
public function save(CacheItemInterface $item): bool
    {
        if ($item->getKey()) {
            return $this->set($item->getKey(), $item->get(), $item->getExpire());
        }

        return false;
    }
1074228
public function getItem($item)
	{
		return isset($this->items[$item]) ? $this->items[$item] : false;
	}
1066521
public function doSerialize(EventInterface $event)/*# : bool */
    {
        /* @var CacheItem $item */
        $item = $event->getParam('item');
        $item->setStrVal(serialize($item->get()));
        return true;
    }
876577
protected function _calculateItemId(EntityInterface $item)
    {
        if ($item->has('id')) {
            return $item->id;
        }

        if (is_array($item->url)) {
            return Inflector::slug(strtolower(implode(' ', array_values($item->url))));
        }

        return Inflector::slug(strtolower($item->url));
    }
69846
public function addInclude(ItemInterface $item)
    {
        if ($this->hasInclude($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous include item exists with the same id: "%s".', $item->getId()));
        }

        $this->includes[$item->getId()] = $item;
    }
996732
protected function checkType($item)
    {
        $type = $this->getItemType($item);
        if (! $this->type) {
            $this->type = $type;

            return true;
        }

        if ($this->type != $type) {
            return false;
        }

        return true;
    }
963187
public function isInPerimeter($item, PerimeterInterface $perimeter)
    {
        if (isset($this->strategies[$perimeter->getType()])) {
            return $this->strategies[$perimeter->getType()]->isInPerimeter($item, $perimeter);
        }

        return false;
    }
504146
public function saveDeferred(CacheItemInterface $item)
    {
        $this->cache->set($item->getKey(), $item);
        return true;
    }
825373
public function addItem(ItemInterface $item)
    {
        if ($this->hasItem($item->getId()) === true) {
            throw new \RuntimeException(sprintf('A previous item exists with the same id: "%s".', $item->getId()));
        }

        $this->items[$item->getId()] = $item;
    }
885112
public function isExpired(CacheItemInterface $item)
    {
        if ($item->isExpired()) {
            $this->delete($item->getKey());

            return true;
        }

        return false;
    }
1189745
protected function _renderItem(ItemInterface $item, array $options)
    {
        if (!$item->isDisplayed()) {
            return '';
        }

        $level = $item->getLevel();

        $class = (array)$item->getAttribute('class');

        if ($this->_matcher->isCurrent($item)) {
            $class[] = $options['currentClass'];
        } elseif (isset($options['ancestorClass']) &&
            $this->_matcher->isAncestor($item, $options['matchingDepth'])
        ) {
            $class[] = $options['ancestorClass'];
        }

        if (isset($options['firstClass']) &&
            $item->actsLikeFirst()
        ) {
            $class[] = $options['firstClass'];
        }
        if (isset($options['lastClass']) &&
            $item->actsLikeLast()
        ) {
            $class[] = $options['lastClass'];
        }

        $hasChildren = $item->hasChildren();
        if ($hasChildren &&
            $options['depth'] !== 0
        ) {
            if ($options['branchClass'] !== null &&
                $item->getDisplayChildren()
            ) {
                $class[] = $options['branchClass'];
            }
        } elseif ($options['leafClass'] !== null) {
            $class[] = $options['leafClass'];
        }

        $attributes = $item->getAttributes();
        if (!empty($class)) {
            $attributes['class'] = implode(' ', $class);
        }

        $templater = $this->templater();

        $attributes = $this->_formatAttributes($attributes, $item);

        $templates = (array)$item->getExtra('templates');
        $defaultTemplates = (array)$item->getExtra('defaultTemplates');
        $newTemplates = $templates + $defaultTemplates;
        if ($newTemplates) {
            $templater->push();
            $templater->add($newTemplates);
        }

        $templateVars = (array)$item->getExtra('templateVars');
        $defaultTemplateVars = (array)$item->getExtra('defaultTemplateVars');
        $currentDefaultTemplateVars = (array)$options['defaultTemplateVars'];
        $templateVars =
            $templateVars +
            $defaultTemplateVars +
            $currentDefaultTemplateVars;
        if (empty($templateVars)) {
            $templateVars = null;
        }
        $options['templateVars'] = $templateVars;

        $link = $this->_renderLink($item, $options);

        if ($hasChildren) {
            $nestedClass = (array)$item->getChildrenAttribute('class');
            if ($options['menuLevelClass'] !== null) {
                $nestedClass[] = $options['menuLevelClass'] . $level;
            }
            if ($options['nestedMenuClass'] !== null) {
                $nestedClass[] = $options['nestedMenuClass'];
            }
            $nestedAttributes = $item->getChildrenAttributes();
            $nestedAttributes['class'] = implode(' ', $nestedClass);
            $options['attributes'] = $nestedAttributes;

            $options['childrenTemplates'] = null;
            if ($newTemplates) {
                // item defines new templates that must be ignored by the children
                $options['childrenTemplates'] = $options['defaultTemplates'];
            }
            if ($defaultTemplates) {
                // item defines default templates that must be used by the children
                $options['childrenTemplates'] = $defaultTemplates;
            }

            if ($defaultTemplateVars) {
                // item defines default template vars that must be used by the children
                $options['defaultTemplateVars'] =
                    $defaultTemplateVars +
                    $currentDefaultTemplateVars;
            }

            $nested = $this->_renderNested($item, $options);
        } else {
            $nested = '';
        }

        $rendered = (string)$templater->format('item', [
            'attrs' => $attributes,
            'templateVars' => $templateVars,
            'link' => $link,
            'nest' => $nested
        ]);

        if ($newTemplates) {
            $templater->pop();
        }

        return $rendered;
    }