W3cubDocs

/Symfony 4.1

ConstraintViolationListInterface

interface ConstraintViolationListInterface implements Traversable, Countable, ArrayAccess

A list of constraint violations.

Methods

add(ConstraintViolationInterface $violation)

Adds a constraint violation to this list.

addAll(ConstraintViolationListInterface $otherList)

Merges an existing violation list into this list.

ConstraintViolationInterface get(int $offset)

Returns the violation at a given offset.

bool has(int $offset)

Returns whether the given offset exists.

set(int $offset, ConstraintViolationInterface $violation)

Sets a violation at a given offset.

remove(int $offset)

Removes a violation at a given offset.

Details

add(ConstraintViolationInterface $violation)

Adds a constraint violation to this list.

Parameters

ConstraintViolationInterface $violation

addAll(ConstraintViolationListInterface $otherList)

Merges an existing violation list into this list.

Parameters

ConstraintViolationListInterface $otherList

ConstraintViolationInterface get(int $offset)

Returns the violation at a given offset.

Parameters

int $offset The offset of the violation

Return Value

ConstraintViolationInterface The violation

Exceptions

OutOfBoundsException if the offset does not exist

bool has(int $offset)

Returns whether the given offset exists.

Parameters

int $offset The violation offset

Return Value

bool Whether the offset exists

set(int $offset, ConstraintViolationInterface $violation)

Sets a violation at a given offset.

Parameters

int $offset The violation offset
ConstraintViolationInterface $violation The violation

remove(int $offset)

Removes a violation at a given offset.

Parameters

int $offset The offset to remove

© 2004–2017 Fabien Potencier
Licensed under the MIT License.
https://api.symfony.com/4.1/Symfony/Component/Validator/ConstraintViolationListInterface.html