@param $menu
@param $item

@return mixed
12294
private function buildSubjectItem($menu, $item)
    {
        if (! empty($item->subject_type) && ! is_null($item->subject)) {
            return $menu->add($item->name, ['url' => $item->subject->getRouteForMenuItem()]);
        }

        return false;
    }
574035
public function getParentMenu(Menu $menu, MenuItem $childNode)
    {
        $itemIterator = new RecursiveItemIterator($menu->getIterator());
        $iterator = new \RecursiveIteratorIterator($itemIterator, \RecursiveIteratorIterator::SELF_FIRST);
        foreach ($iterator as $menuItem) {
            $parentId = $childNode->getParent()->getId();
            if ($menuItem->getName() != $parentId) {
                continue;
            }

            return $menuItem;
        }

        return false;
    }
200417
public static function get($item)
    {
        if (isset($_POST[$item])) {
            return $_POST[$item];
        } elseif (isset($_GET[$item])) {
            return $_GET[$item];
        } else {
            return '';
        }
    }
794223
public function getItemUrl($item)
    {
        $item = $this->getItem($item);
        return $item ? $item->normalizedUrl : null;
    }
225116
public static function menuLink($item)
    {
        $app = \JFactory::getApplication();
        $menu = $app->getMenu();
        $item = $menu->getItem($item);

        return \JRoute::_($item->link . '&Itemid=' . $item->id);
    }
565737
public List<MenuItem> getMenuItems(MenuItem item) {
        synchronized (subMenuItems) {
            ArrayList<MenuItem> menuItems = subMenuItems.get(item);
            return menuItems == null ? null : Collections.unmodifiableList(menuItems);
        }
    }
1196562
private function addItem(Item $item)
    {
        $em = $this->getDoctrine()->getManager();
        $em->persist($item);
        $em->flush();

        return $this->redirect($this->generateUrl(
            'item_show',
            ['id' => $item->getId(), 'name' => $item->getUrlName()]
        ));
    }
631957
protected function getItemTotal($item)
    {
        return $item->getRowTotal() - $item->getDiscountAmount() + $item->getTaxAmount() + $item->getWeeeTaxAppliedRowAmount();
    }
81351
protected function getOriginCover(Item $item)
    {
        if (!$this->origin_dir) {
            $this->origin_dir = $this->kernel->locateResource('@AnimeDbCatalogBundle/Resources/private/images/');
        }

        return $this->origin_dir.$item->getItem()->getCover();
    }
715368
public static function get($item, $default = null)
	{
		is_null(static::$default_check_value) and static::$default_check_value = pack('H*', 'DEADBEEFCAFE');

		if (isset(static::$items[$item]))
		{
			return static::$items[$item];
		}
		elseif ( ! isset(static::$itemcache[$item]))
		{
			$val = \Fuel::value(\Arr::get(static::$items, $item, static::$default_check_value));

			if ($val === static::$default_check_value)
			{
				return $default;
			}

			if ( ! is_scalar($val))
			{
				return $val;
			}

			static::$itemcache[$item] = $val;
		}

		return static::$itemcache[$item];
	}
105569
public function getRow($item)
	{
		$row = [];

		foreach ($this->columns as $column) {
			$row[] = strip_tags($column->render($item));
		}

		return $row;
	}
773605
public function isMainMenuItemActive($item)
    {
        return $this->contextOwner == $item->owner && $this->contextMainMenuItemCode == $item->code;
    }
560926
public function current($item, $level = null)
    {
        if (is_null($item)) {
            return null;
        }

        if (!$item instanceof MenuItem) {
            throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item)));
        }

        /** @var MenuItem $child */
        foreach ($item->getChildren() as $child) {
            if (
                (null !== $this->matcher && $this->matcher->isAncestor($child))
             || (null === $this->matcher && $child->isCurrentAncestor())
            ) {
                if ($level !== null and $level == $child->getLevel()) {
                    return $child;
                }

                return $this->current($child);
            }

            if (
                (null !== $this->matcher && $this->matcher->isCurrent($child))
             || (null === $this->matcher && $child->isCurrent())
            ) {
                return $child;
            }
        }

        return null;
    }
1216149
protected function getItemOrderOptions($item)
    {
        $result = array();
        if ($options = $item->getProductOptions()) {
            if (isset($options['options'])) {
                $result = array_merge($result, $options['options']);
            }
            if (isset($options['additional_options'])) {
                $result = array_merge($result, $options['additional_options']);
            }
            if (!empty($options['attributes_info'])) {
                $result = array_merge($options['attributes_info'], $result);
            }
        }
        return $result;
    }
112480
public function activeTrail($item)
    {
        if (is_null($item)) {
            return null;
        }

        if (!$item instanceof MenuItem) {
            throw new \UnexpectedValueException(sprintf('$ITEM must be \Knp\Menu\MenuItem not "%s"', get_class($item)));
        }

        $stack = array();

        do {
            $stack[]= $item;
        } while ($item = $item->getParent());

        return array_reverse($stack);
    }
862763
public function deleteAction(Item $item)
    {
        $em = $this->getDoctrine()->getManager();
        $em->remove($item);
        $em->flush();

        return $this->redirect($this->generateUrl('home'));
    }
260882
public function getContainerValues(&$item)
    {
        if (false === is_object($item) && false === is_array($item)) {
            $item = $this->getContainerServices($this->getContainerParameters($item));
        }

        return $item;
    }