public function ConstraintViolationList::__construct

Creates a new constraint violation list.

Parameters

ConstraintViolationInterface[] $violations The constraint violations to add to the list:

File

drupal/core/vendor/symfony/validator/Symfony/Component/Validator/ConstraintViolationList.php, line 31

Class

ConstraintViolationList
Default implementation of {@ConstraintViolationListInterface}.

Namespace

Symfony\Component\Validator

Code

public function __construct(array $violations = array()) {
  foreach ($violations as $violation) {
    $this
      ->add($violation);
  }
}