You are here

public function Constraint::__set in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/symfony/validator/Constraint.php \Symfony\Component\Validator\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.

Parameters

string $option The option name:

mixed $value The value to set:

Throws

InvalidOptionsException If an invalid option name is given

1 call to Constraint::__set()
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 185

Class

Constraint
Contains the properties of a constraint definition.

Namespace

Symfony\Component\Validator

Code

public function __set($option, $value) {
  if ('groups' === $option) {
    $this->groups = (array) $value;
    return;
  }
  throw new InvalidOptionsException(sprintf('The option "%s" does not exist in constraint %s', $option, get_class($this)), array(
    $option,
  ));
}