Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MenuLinkTreeElement.php

function MenuLinkTreeElement::__construct

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 102

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;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal