You are here

public function ConstraintViolationList::__construct in Plug 7

Creates a new constraint violation list.

Parameters

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

File

lib/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);
  }
}