public function matchItem(ItemInterface $item) { if (null === $this->uri || null === $item->getUri()) { return null; } if ($item->getUri() === $this->uri) { return true; } return null; }
public function isAncestor(ItemInterface $item, $depth = null) { if (0 === $depth) { return false; } $childDepth = null === $depth ? null : $depth - 1; foreach ($item->getChildren() as $child) { if ($this->isCurrent($child) || $this->isAncestor($child, $childDepth)) { return true; } } return false; }
public function moveChildToPosition(ItemInterface $child, $position) { $name = $child->getName(); $order = array_keys($this->children); $_position = array_search($name, $order); unset($order[$_position]); $order = array_values($order); array_splice($order, $position, 0, $name); $this->reorderChildren($order); return $this; }
protected function renderLabel(ItemInterface $item, array $options) { if ($options['allow_safe_labels'] && $item->getExtra('safe_label', false)) { return $item->getLabel(); } return $this->escape($item->getLabel()); }