Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Constraint.php

function Constraint::__set

Sets the value of a lazily initialized option.

Corresponding properties are added to the object on first access. Hence this method will be called at most once per constraint instance and option name.

Throws

InvalidOptionsException If an invalid option name is given

2 calls to Constraint::__set()
File::__set in vendor/symfony/validator/Constraints/File.php
Sets the value of a lazily initialized option.
File::__set in vendor/symfony/validator/Constraints/File.php
Sets the value of a lazily initialized option.
1 method overrides Constraint::__set()
File::__set in vendor/symfony/validator/Constraints/File.php
Sets the value of a lazily initialized option.

File

vendor/symfony/validator/Constraint.php, line 189

Class

Constraint
Contains the properties of a constraint definition.

Namespace

Symfony\Component\Validator

Code

public function __set(string $option, mixed $value) : void {
    if ('groups' === $option) {
        $this->groups = (array) $value;
        return;
    }
    throw new InvalidOptionsException(\sprintf('The option "%s" does not exist in constraint "%s".', $option, static::class), [
        $option,
    ]);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal