You are here

public function MenuTreeParameters::setMinDepth in Drupal 10

Same name and namespace in other branches
  1. 8 core/lib/Drupal/Core/Menu/MenuTreeParameters.php \Drupal\Core\Menu\MenuTreeParameters::setMinDepth()
  2. 9 core/lib/Drupal/Core/Menu/MenuTreeParameters.php \Drupal\Core\Menu\MenuTreeParameters::setMinDepth()

Sets a minimum depth for menu tree loading.

Parameters

int $min_depth: The (root-relative) minimum depth to apply.

Return value

$this

File

core/lib/Drupal/Core/Menu/MenuTreeParameters.php, line 97

Class

MenuTreeParameters
Provides a value object to model menu tree parameters.

Namespace

Drupal\Core\Menu

Code

public function setMinDepth($min_depth) {
  $this->minDepth = max(1, $min_depth);
  return $this;
}