class ImmutablePropertiesConstraint

Same name in other branches
  1. 11.x core/lib/Drupal/Core/Entity/Plugin/Validation/Constraint/ImmutablePropertiesConstraint.php \Drupal\Core\Entity\Plugin\Validation\Constraint\ImmutablePropertiesConstraint

Checks if config entity properties have been changed.

Hierarchy

Expanded class hierarchy of ImmutablePropertiesConstraint

File

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

Namespace

Drupal\Core\Entity\Plugin\Validation\Constraint
View 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}
     *
     * @return ?string
     *   Name of the default option.
     *
     * @todo Add method return type declaration.
     * @see https://www.drupal.org/project/drupal/issues/3425150
     */
    public function getDefaultOption() {
        return 'properties';
    }
    
    /**
     * {@inheritdoc}
     *
     * @return array
     *   The names of the required options.
     *
     * @todo Add method return type declaration.
     * @see https://www.drupal.org/project/drupal/issues/3425150
     */
    public function getRequiredOptions() {
        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 @todo Add method return type declaration.
ImmutablePropertiesConstraint::getRequiredOptions public function @todo Add method return type declaration.

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