function ImmutablePropertiesConstraint::__construct

Same name and namespace in other branches
  1. 11.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ImmutablePropertiesConstraint.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ImmutablePropertiesConstraint::__construct()

Attributes

#[HasNamedArguments]

File

core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ImmutablePropertiesConstraint.php, line 29

Class

ImmutablePropertiesConstraint
Checks if config entity properties have been changed.

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint

Code

public function __construct(mixed $options = NULL, ?array $properties = NULL, public string $message = "The '@name' property cannot be changed.", ?array $groups = NULL, mixed $payload = NULL) {
  parent::__construct($options, $groups, $payload);
  $this->properties = $properties ?? $this->properties;
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.