@param ListItemInterface $item
@param $listPageUrl

@return ListItemInterface
506532
private function addPagerInfoToItem(ListItemInterface $item, $listPageUrl)
    {
        $pagerParameter = $this->requestToListUrlConverter->getPagerParameter($this->requestToListUrlConverter->getListSpotName(), $listPageUrl);
        $modifiedUrl = $this->addParametersToUrlService->addParameterToUrl($item->getUrl(), $pagerParameter);
        $item->setUrl($modifiedUrl);

        return $item;
    }
618819
protected function buildListItem(string $item, string $marker, int $nestingLevel): string
	{
		return str_repeat($this->padding, $nestingLevel) . $marker . ' ' . $item . PHP_EOL;
	}
459596
private function searchNext($currentArticleId, $listUrl)
    {
        if (null === $listUrl) {
            return null;
        }

        $page = $this->listApi->get($listUrl, $this->requestToListUrlConverter->getListSpotName());
        $items = $page->getItemList();
        if (0 === count($items)) {
            return null;
        }

        $keys = array_keys($items);
        $positionCurrentElement = array_search($currentArticleId, $keys);
        if (false === $positionCurrentElement) {
            return null;
        }

        $positionNextElement = $positionCurrentElement + 1;
        // if we are the last element, we need to get the first of the next page
        if ($positionNextElement === count($keys)) {
            $nextPageUrl = $page->getNextPageUrl();
            if (null === $nextPageUrl) {
                return null;
            }
            $nextPage = $this->listApi->get($nextPageUrl, $this->requestToListUrlConverter->getListSpotName());
            $nextItems = $nextPage->getItemList();
            if (0 === count($nextItems)) {
                return null;
            }
            reset($nextItems);

            return array('item' => current($nextItems), 'pageUrl' => $nextPageUrl);
        }

        return array('item' => $items[$keys[$positionNextElement]], 'pageUrl' => $listUrl);
    }
939077
public function setPerPageList(array $perPageList)
    {
        $this->perPageList = $perPageList;

        if ($this->hasFilters(FALSE) || $this->hasOperation(FALSE)) {
            $this['form']['count']->setItems($this->getItemsForCountSelect());
        }

        return $this;
    }
985592
private function _getSiteIdsFromTree( MShop_Locale_Item_Site_Interface $item )
	{
		$list = array( $item->getId() );

		foreach( $item->getChildren() as $child ) {
			$list = array_merge( $list, $this->_getSiteIdsFromTree( $child ) );
		}

		return $list;
	}
595080
protected function generateSitemapPageData($pageUrl)
    {
        $page = $GLOBALS['TSFE']->page;

        $tstamp = $_SERVER['REQUEST_TIME'];

        $ret = array(
            'tstamp'                => $tstamp,
            'crdate'                => $tstamp,
            'page_rootpid'          => GeneralUtility::getRootPid(),
            'page_uid'              => $GLOBALS['TSFE']->id,
            'page_language'         => GeneralUtility::getLanguageId(),
            'page_url'              => $pageUrl,
            'page_depth'            => count($GLOBALS['TSFE']->rootLine),
            'page_change_frequency' => $this->getPageChangeFrequency($page),
            'page_type'             => SitemapUtility::SITEMAP_TYPE_PAGE,
            'expire'                => $this->indexExpiration,
        );

        // Call hook
        GeneralUtility::callHookAndSignal(__CLASS__, 'sitemapIndexPage', $this, $ret);

        return $ret;
    }
1183231
public function add($item)
    {
        foreach ($this->_requiredInterfaces as $interface) {
            if (!$item instanceof $interface) {
                throw new RuntimeException(
                    sprintf('Item "%s" should implement "%s" interface', get_class($item), $interface)
                );
            }
        }
        
        $this->_items[spl_object_hash($item)] = $item;
        return $this;
    }
230694
private function createLinkManagerMenuItem(): ?ItemInterface
    {
        if (!$this->permissionResolver->hasAccess('url', 'view')) {
            return null;
        }

        return $this->factory->createItem(
            self::ITEM_CONTENT__LINK_MANAGER,
            [
                'route' => 'ezplatform.link_manager.list',
                'extras' => [
                    'routes' => [
                        'edit' => 'ezplatform.link_manager.edit',
                        'view' => 'ezplatform.link_manager.view',
                    ],
                ],
            ]
        );
    }
500953
public function getWidgetItem(array $item) {
        $entity = new ItemWidget();

        $entity->setName($this->getItemName($item));
        $entity->setLink($this->browser->getHost().$item['url']);
        $entity->setCover($this->browser->getHost().$item['image']['original']);

        $catalog_item = $this->getCatalogItem($item);
        if ($catalog_item instanceof Item) {
            $entity->setItem($catalog_item);
        } elseif ($this->filler instanceof Filler) {
            $entity->setLinkForFill($this->filler->getLinkForFill($entity->getLink()));
        }

        return $entity;
    }
909389
public function getItemForPagination(
        string $status = '',
        string $text = '',
        string $url = '',
        string $rel = '',
        string $page = ''
    ): array {
        return [
            'status' => $status,
            'text'   => $text,
            'url'    => $url,
            'rel'    => $rel,
            'page'   => $page,
        ];
    }
1089939
public function getCollectionForItem(ItemInterface $item)
    {
        foreach ($this->colectionItemCollection as $name => $collection) {
            $itemPath = $item->getPath(ItemInterface::SNAPSHOT_PATH_RELATIVE).'/';
            $collectionPath = $collection->getPath().'/';

            if (strpos($itemPath, $collectionPath) === 0) {
                return $collection;
            }
        }

        return $this->colectionItemCollection->get('pages');
    }
732478
public static function createMenuItem(array $item): MenuItemInterface
    {
        $menuItem = static::_getMenuItemObject($item);
        foreach ($item as $key => $value) {
            if ($key == 'children') {
                foreach ($value as $k => $v) {
                    $childItem = static::createMenuItem($v);
                    $menuItem->addMenuItem($childItem);
                }
            } elseif ($key == 'attributes') {
                foreach ($value as $k => $v) {
                    $menuItem->addAttribute($k, $v);
                }
            } elseif ($key == 'viewElement') {
                call_user_func_array([$menuItem, 'setViewElement'], $value);
            } else {
                $method = 'set' . ucfirst(Inflector::camelize($key));
                if (method_exists($menuItem, $method)) {
                    $menuItem->$method($value);
                }
            }
        }

        return $menuItem;
    }
159131
public function matchItem(ItemInterface $item)
    {
        $request = $this->requestStack->getCurrentRequest();

        $parent = $item->getParent();

        while (null !== $parent->getParent()) {
            $parent = $parent->getParent();
        }

        if ($item->getUri() === $request->getRequestUri() or
            $item->getUri() === $request->attributes->get('__current_folder_path', false)
        ) {
            // URL's completely match
            return true;
        } elseif (
            $item->getUri() !== $request->getBaseUrl().'/' and
            $item->getUri() !== $request->getBaseUrl().'/admin/' and
            $item->getUri() === substr($request->getRequestUri(), 0, strlen($item->getUri())) and
            $request->attributes->get('__selected_inheritance', true) and
            $parent->getExtra('select_intehitance', true)
        ) {
            // URL isn't just "/" and the first part of the URL match
            return true;
        }

        return false;
    }
275983
protected function renderSingleElementHTML(PageLayoutView $parentObject, $item)
    {
        $singleElementHTML = '';
        $unset = false;
        if (!isset($parentObject->tt_contentData['nextThree'][$item['uid']])) {
            $unset = true;
            $parentObject->tt_contentData['nextThree'][$item['uid']] = $item['uid'];
        }
        if (!$parentObject->tt_contentConfig['languageMode']) {
            $singleElementHTML .= '<div class="t3-page-ce-dragitem" id="' . StringUtility::getUniqueId() . '">';
        }
        $singleElementHTML .= $parentObject->tt_content_drawHeader(
            $item,
            $parentObject->tt_contentConfig['showInfo'] ? 15 : 5,
            $parentObject->defLangBinding,
            true,
            true
        );
        $singleElementHTML .= (!empty($item['_ORIG_uid']) ? '<div class="ver-element">' : '')
            . '<div class="t3-page-ce-body-inner t3-page-ce-body-inner-' . $item['CType'] . '">'
            . $parentObject->tt_content_drawItem($item)
            . '</div>'
            . (!empty($item['_ORIG_uid']) ? '</div>' : '');
        $singleElementHTML .= $this->tt_content_drawFooter($parentObject, $item);
        if (!$parentObject->tt_contentConfig['languageMode']) {
            $singleElementHTML .= '</div>';
        }
        if ($unset) {
            unset($parentObject->tt_contentData['nextThree'][$item['uid']]);
        }

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

        return $this;
    }
976354
function getCurrentItemText($item = null)
    {
        $text = $this->getDefaultText();

        if (is_null($item)) {
            $item = $this->getItem();
        }

        if ($item && $item->ID > 0) {
            $labelField = $this->labelField;
            if (isset($item->$labelField)) {
                $text = $item->$labelField;
            } else {
                user_error("PageSearchField can't find field called ".$labelField."on ".$item->ClassName, E_USER_ERROR);
            }

            if (method_exists($item, "Link")) {
                $text = "<a href='{$item->Link()}' target='_blank'>".$text.'</a>';
            }
        }

        return $text;
    }
227074
public function setItem(Item $item = null)
    {
        if ($this->item !== $item) {
            // romove link on this item for old item
            if ($this->item instanceof Item) {
                $tmp = $this->item;
                $this->item = null;
                $tmp->removeSource($this);
            }
            $this->item = $item;
            // add link on this item
            if ($item instanceof Item) {
                $this->item->addSource($this);
            }
        }

        return $this;
    }