function InternalViolation::__get

Same name in other branches
  1. 9 core/lib/Drupal/Core/Field/InternalViolation.php \Drupal\Core\Field\InternalViolation::__get()
  2. 11.x core/lib/Drupal/Core/Field/InternalViolation.php \Drupal\Core\Field\InternalViolation::__get()

File

core/lib/Drupal/Core/Field/InternalViolation.php, line 49

Class

InternalViolation
Wraps a violation to allow arrayPropertyPath to be deprecated.

Namespace

Drupal\Core\Field

Code

public function __get(string $name) {
    if ($name === 'arrayPropertyPath') {
        @trigger_error('Accessing the arrayPropertyPath property is deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. Use \\Symfony\\Component\\Validator\\ConstraintViolationInterface::getPropertyPath() instead. See https://www.drupal.org/node/3307919', E_USER_DEPRECATED);
        return $this->arrayPropertyPath;
    }
    @trigger_error('Accessing dynamic properties on violations is deprecated in drupal:9.5.0 and is removed from drupal:11.0.0. See https://www.drupal.org/node/3307919', E_USER_DEPRECATED);
    return $this->properties[$name] ?? NULL;
}

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