function MenuLinkDepthConstraint::__construct
Same name and namespace in other branches
- 11.x core/lib/Drupal/Core/Menu/Plugin/Validation/Constraint/MenuLinkDepthConstraint.php \Drupal\Core\Menu\Plugin\Validation\Constraint\MenuLinkDepthConstraint::__construct()
Constructs a MenuLinkDepthConstraint.
Parameters
string|int $baseLevel: The initial level of menu items that are being exposed (zero-based).
string|null $notInRangeMessage: Error message if minimum and maximum are both set and value is less than minimum or more than maximum.
string|null $minMessage: Error message if value is less than minimum.
string|null $maxMessage: Error message if value is more than maximum.
string|null $invalidMessage: The message if min and max values are numeric but the given value is not.
int|float|non-empty-string|null $min: The minimum value, either numeric or a datetime string representation.
non-empty-string|null $minPropertyPath: Property path to the min value.
int|float|non-empty-string|null $max: The maximum value, either numeric or a datetime string representation.
non-empty-string|null $maxPropertyPath: Property path to the max value.
array|null $groups: The groups that the constraint belongs to.
mixed|null $payload: Domain-specific data attached to a constraint.
Overrides RangeConstraint::__construct
File
-
core/
lib/ Drupal/ Core/ Menu/ Plugin/ Validation/ Constraint/ MenuLinkDepthConstraint.php, line 48
Class
- MenuLinkDepthConstraint
- Validates the link depth of a menu tree.
Namespace
Drupal\Core\Menu\Plugin\Validation\ConstraintCode
public function __construct(public readonly string|int $baseLevel = 0, ?string $notInRangeMessage = NULL, ?string $minMessage = NULL, ?string $maxMessage = NULL, ?string $invalidMessage = NULL, mixed $min = NULL, ?string $minPropertyPath = NULL, mixed $max = NULL, ?string $maxPropertyPath = NULL, ?array $groups = NULL, mixed $payload = NULL) {
parent::__construct($notInRangeMessage, $minMessage, $maxMessage, $invalidMessage, NULL, $min, $minPropertyPath, $max, $maxPropertyPath, $groups, $payload);
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.