W3cubDocs

/Drupal 8

public function MenuLinkTreeElement::__construct

public MenuLinkTreeElement::__construct(MenuLinkInterface $link, $has_children, $depth, $in_active_trail, array $subtree)

Constructs a new \Drupal\Core\Menu\MenuLinkTreeElement.

Parameters

\Drupal\Core\Menu\MenuLinkInterface $link: The menu link for this element in the menu link tree.

bool $has_children: A flag as to whether this element has children even if they are not included in the tree (i.e. this may be TRUE even if $subtree is empty).

int $depth: The depth of this element relative to the tree root.

bool $in_active_trail: A flag as to whether this link was included in the list of active trail IDs used to build the tree.

\Drupal\Core\Menu\MenuLinkTreeElement[] $subtree: The children of this element in the menu link tree.

File

core/lib/Drupal/Core/Menu/MenuLinkTreeElement.php, line 100

Class

MenuLinkTreeElement
Provides a value object to model an element in a menu link tree.

Namespace

Drupal\Core\Menu

Code

public function __construct(MenuLinkInterface $link, $has_children, $depth, $in_active_trail, array $subtree) {
  // Essential properties.
  $this->link = $link;
  $this->hasChildren = $has_children;
  $this->depth = $depth;
  $this->subtree = $subtree;
  $this->inActiveTrail = $in_active_trail;
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/core!lib!Drupal!Core!Menu!MenuLinkTreeElement.php/function/MenuLinkTreeElement::__construct/8.1.x