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