Determines if an url is active or not.

@param array $item the item config
@return bool true if active
336377
protected function isItemActive($item)
	{
		if (!isset($item['url'])) return false;

		if (is_callable($this->isActiveCallback)) {
			return call_user_func($this->isActiveCallback, $item);
		} else {
			return \asinfotrack\yii2\toolbox\helpers\Url::isUrlActive($item['url']);
		}
	}
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;
    }
44611
protected function setActive(ItemInterface $item = null)
    {
        if ($item) {
            $this->setActive($item->getParent());
            $item->setAttribute('class', $item->getAttribute('class', '') . ' active');
        }
    }
1144301
public function isYamlFile($item)
    {
        return
            $this->isFile($item) && (
                ends_with(strtolower($item), '.yml') ||
                ends_with(strtolower($item), '.yaml')
            );
    }
1084554
private function makeActive($item, $parent = null)
    {
        $item->links->each(function ($link) use ($item, $parent) {
            if ($link->slug == $this->active) {
                $this->makeParentActive($parent);
                $this->makeParentActive($item);

                $link->setActive(true);
            }

            if (isset($link->links)) {
                $this->makeActive($link, $item);
            }
        });
    }
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
            )
        );
    }
836933
protected function enqueue($item) {
    $count = count($this->queue);

    if ($count > $this->max_queue_size) {
      return false;
    }

    $count = array_push($this->queue, $item);

    if ($count >= $this->batch_size) {
      return $this->flush(); // return ->flush() result: true on success
    }

    return true;
  }
206530
protected function isPageIndexable(Item $item)
    {

        // TODO do we still need this?
        // shouldn't those be sorted out by the record monitor / garbage collector already?

        $isIndexable = true;
        $record = $item->getRecord();

        if (isset($GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['disabled'])
            && $record[$GLOBALS['TCA']['pages']['ctrl']['enablecolumns']['disabled']]
        ) {
            $isIndexable = false;
        }

        return $isIndexable;
    }
399343
protected function isValid($item)
    {
        if ((!$item instanceof stdClass)
            || !isset($item->type)
            || !isset($item->modifiers)
        ) {
            return false;
        }

        if ($this->doctypeValidationEnabled) {
            if (!isset($item->content)
                && (! $this->view->plugin('doctype')->isHtml5()
                || (! $this->view->plugin('doctype')->isHtml5() && $item->type !== 'charset'))
            ) {
                return false;
            }

            // <meta itemprop= ... /> is only supported with doctype html
            if (! $this->view->plugin('doctype')->isHtml5()
                && $item->type === 'itemprop'
            ) {
                return false;
            }

            // <meta property= ... /> is only supported with doctype RDFa
            if (!$this->view->plugin('doctype')->isRdfa()
                && $item->type === 'property'
            ) {
                return false;
            }
        }

        return true;
    }
722760
private static function isSorted($item)
    {
        return
            (is_object($item) && null !== $item->getPosition())
            ||
            (is_array($item) && isset($item[static::POSITION_KEY]));
    }
772517
public function getUrlFor($item)
    {
        $routeGenerator = $this->routerGenerator;
        if (is_callable($routeGenerator)) {
            return $routeGenerator($item);
        }

        return null;
    }
1337707
public function isWatching(Item $item)
    {
        return (bool) $this->watching()->where('items.item_id', $item->itemId)->count();
    }
773605
public function isMainMenuItemActive($item)
    {
        return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
    }
58787
public function isActive($currentUrl)
    {
        $activeUrls = $this->getActiveUrls();

        return
            $currentUrl == $this->url ||
            (
                is_array($activeUrls) &&
                in_array($currentUrl, $this->getActiveUrls())
            );
    }
794223
public function getItemUrl($item)
    {
        $item = $this->getItem($item);
        return $item ? $item->normalizedUrl : null;
    }
389990
private function isExpired(array $item) : bool
    {
        return isset($item[static::EXPIRATION_FIELD]) &&
            $item[self::EXPIRATION_FIELD] !== null &&
            $item[self::EXPIRATION_FIELD] < time();
    }
801293
public function contains($item)
    {
        if ($item instanceof AbstractEntity) {
            $item = $item->id;
        }
        foreach ($this->value as $entity) {
            $eId = $entity->id;
            if (!$this->isNull($eId) && $eId == $item) {
                return true;
            }
        }

        return false;
    }