class ImmutablePropertiesConstraint
Checks if config entity properties have been changed.
Attributes
#[Constraint(id: 'ImmutableProperties', label: new TranslatableMarkup('Properties are unchanged', [], [
'context' => 'Validation',
]), type: [
'entity',
])]
Hierarchy
- class \Drupal\Core\Entity\Plugin\Validation\Constraint\ImmutablePropertiesConstraint extends \Symfony\Component\Validator\Constraint
Expanded class hierarchy of ImmutablePropertiesConstraint
1 file declares its use of ImmutablePropertiesConstraint
- ImmutablePropertiesConstraintValidatorTest.php in core/
tests/ Drupal/ KernelTests/ Core/ Entity/ ImmutablePropertiesConstraintValidatorTest.php
File
-
core/
lib/ Drupal/ Core/ Entity/ Plugin/ Validation/ Constraint/ ImmutablePropertiesConstraint.php, line 14
Namespace
Drupal\Core\Entity\Plugin\Validation\ConstraintView source
class ImmutablePropertiesConstraint extends SymfonyConstraint {
/**
* The error message if an immutable property has been changed.
*
* @var string
*/
public string $message = "The '@name' property cannot be changed.";
/**
* The names of the immutable properties.
*
* @var string[]
*/
public array $properties = [];
/**
* {@inheritdoc}
*/
public function getDefaultOption() : ?string {
return 'properties';
}
/**
* {@inheritdoc}
*/
public function getRequiredOptions() : array {
return [
'properties',
];
}
}
Members
| Title Sort descending | Modifiers | Object type | Summary |
|---|---|---|---|
| ImmutablePropertiesConstraint::$message | public | property | The error message if an immutable property has been changed. |
| ImmutablePropertiesConstraint::$properties | public | property | The names of the immutable properties. |
| ImmutablePropertiesConstraint::getDefaultOption | public | function | |
| ImmutablePropertiesConstraint::getRequiredOptions | public | function |
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.