You are here

public function ConstraintViolationList::add in Plug 7

Adds a constraint violation to this list.

@api

Parameters

ConstraintViolationInterface $violation The violation to add.:

Overrides ConstraintViolationListInterface::add

2 calls to ConstraintViolationList::add()
ConstraintViolationList::offsetSet in lib/Symfony/validator/Symfony/Component/Validator/ConstraintViolationList.php
ConstraintViolationList::__construct in lib/Symfony/validator/Symfony/Component/Validator/ConstraintViolationList.php
Creates a new constraint violation list.

File

lib/Symfony/validator/Symfony/Component/Validator/ConstraintViolationList.php, line 57

Class

ConstraintViolationList
Default implementation of {@ConstraintViolationListInterface}.

Namespace

Symfony\Component\Validator

Code

public function add(ConstraintViolationInterface $violation) {
  $this->violations[] = $violation;
}