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

Breadcrumb

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

function ExecutionContext::addViolation

Same name in this branch
  1. 11.1.x core/lib/Drupal/Core/Validation/ExecutionContext.php \Drupal\Core\Validation\ExecutionContext::addViolation()

Overrides ExecutionContextInterface::addViolation

File

vendor/symfony/validator/Context/ExecutionContext.php, line 134

Class

ExecutionContext
The context used and created by {@link ExecutionContextFactory}.

Namespace

Symfony\Component\Validator\Context

Code

public function addViolation(string|\Stringable $message, array $parameters = []) : void {
    $this->violations
        ->add(new ConstraintViolation($this->translator
        ->trans($message, $parameters, $this->translationDomain), $message, $parameters, $this->root, $this->propertyPath, $this->getValue(), null, null, $this->constraint));
}

API Navigation

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