class MenuLinkDepthConstraint
Validates the link depth of a menu tree.
Attributes
#[Constraint(id: 'MenuLinkDepth', label: new TranslatableMarkup('Menu link depth', options: [
'context' => 'Validation',
]), type: [
'integer',
])]
Hierarchy
- class \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint extends \Symfony\Component\Validator\Constraints\Range
- class \Drupal\Core\Menu\Plugin\Validation\Constraint\MenuLinkDepthConstraint extends \Drupal\Core\Validation\Plugin\Validation\Constraint\RangeConstraint
Expanded class hierarchy of MenuLinkDepthConstraint
File
-
core/
lib/ Drupal/ Core/ Menu/ Plugin/ Validation/ Constraint/ MenuLinkDepthConstraint.php, line 15
Namespace
Drupal\Core\Menu\Plugin\Validation\ConstraintView source
class MenuLinkDepthConstraint extends RangeConstraint {
/**
* @param string|int $baseLevel
* The initial level of menu items that are being exposed (zero-based).
* @param array<string, mixed> $args
* Additional arguments to pass to parent constructor.
*/
public function __construct(public readonly string|int $baseLevel = 0, ...$args) {
parent::__construct(...$args);
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary | Overriden Title |
|---|---|---|---|---|
| MenuLinkDepthConstraint::__construct | public | function | #[HasNamedArguments] | Overrides RangeConstraint::__construct |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.