class MenuTreeHierarchyConstraint in Drupal 10
Same name and namespace in other branches
- 8 core/modules/menu_link_content/src/Plugin/Validation/Constraint/MenuTreeHierarchyConstraint.php \Drupal\menu_link_content\Plugin\Validation\Constraint\MenuTreeHierarchyConstraint
- 9 core/modules/menu_link_content/src/Plugin/Validation/Constraint/MenuTreeHierarchyConstraint.php \Drupal\menu_link_content\Plugin\Validation\Constraint\MenuTreeHierarchyConstraint
Validation constraint for changing the menu hierarchy in pending revisions.
Plugin annotation
@Constraint(
id = "MenuTreeHierarchy",
label = @Translation("Menu tree hierarchy.", context = "Validation"),
)
Hierarchy
- class \Drupal\Core\Entity\Plugin\Validation\Constraint\CompositeConstraintBase extends \Symfony\Component\Validator\Constraint
- class \Drupal\menu_link_content\Plugin\Validation\Constraint\MenuTreeHierarchyConstraint
Expanded class hierarchy of MenuTreeHierarchyConstraint
File
- core/
modules/ menu_link_content/ src/ Plugin/ Validation/ Constraint/ MenuTreeHierarchyConstraint.php, line 15
Namespace
Drupal\menu_link_content\Plugin\Validation\ConstraintView source
class MenuTreeHierarchyConstraint extends CompositeConstraintBase {
/**
* The default violation message.
*
* @var string
*/
public $message = 'You can only change the hierarchy for the <em>published</em> version of this menu link.';
/**
* {@inheritdoc}
*/
public function coversFields() {
return [
'parent',
'weight',
];
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
MenuTreeHierarchyConstraint:: |
public | property | The default violation message. | |
MenuTreeHierarchyConstraint:: |
public | function |
An array of entity fields which should be passed to the validator. Overrides CompositeConstraintBase:: |