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

Breadcrumb

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

function Constraint::__get

Returns 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

4 calls to Constraint::__get()
File::__get in vendor/symfony/validator/Constraints/File.php
Returns the value of a lazily initialized option.
File::__get in vendor/symfony/validator/Constraints/File.php
Returns the value of a lazily initialized option.
Valid::__get in vendor/symfony/validator/Constraints/Valid.php
Returns the value of a lazily initialized option.
Valid::__get in vendor/symfony/validator/Constraints/Valid.php
Returns the value of a lazily initialized option.
2 methods override Constraint::__get()
File::__get in vendor/symfony/validator/Constraints/File.php
Returns the value of a lazily initialized option.
Valid::__get in vendor/symfony/validator/Constraints/Valid.php
Returns the value of a lazily initialized option.

File

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

Class

Constraint
Contains the properties of a constraint definition.

Namespace

Symfony\Component\Validator

Code

public function __get(string $option) : mixed {
    if ('groups' === $option) {
        $this->groups = [
            self::DEFAULT_GROUP,
        ];
        return $this->groups;
    }
    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