You are here

public function DepthSetting::alterTree in Menu Bean 7

Alters the menu tree

Parameters

array:

\Bean $bean:

Overrides SettingInterface::alterTree

File

lib/Drupal/menu_bean/Setting/DepthSetting.php, line 45
Level Plugin class

Class

DepthSetting

Namespace

Drupal\menu_bean\Setting

Code

public function alterTree(array &$tree, \Bean $bean) {

  // Trim the branches that extend beyond the specified depth.
  if ($bean->depth > 0) {
    $this
      ->menu_tree_depth_trim($tree, $bean->depth);
  }
}