Class

Symfony\Component\Validator\ConstraintViolationList

class ConstraintViolationList implements IteratorAggregate, ConstraintViolationListInterface

Default implementation of {@ConstraintViolationListInterface}.

Methods

__construct(array $violations = array())

Creates a new constraint violation list.

string __toString()

Converts the violation into a string for debugging purposes.

add(ConstraintViolationInterface $violation)

Adds a constraint violation to this list.

addAll(ConstraintViolationListInterface $otherList)

Merges an existing violation list into this list.

ConstraintViolationInterface get(integer $offset)

Returns the violation at a given offset.

Boolean has(integer $offset)

Returns whether the given offset exists.

set(integer $offset, ConstraintViolationInterface $violation)

Sets a violation at a given offset.

remove(integer $offset)

Removes a violation at a given offset.

getIterator()

{@inheritDoc}

count()

{@inheritDoc}

offsetExists($offset)

{@inheritDoc}

offsetGet($offset)

{@inheritDoc}

offsetSet($offset, $violation)

{@inheritDoc}

offsetUnset($offset)

{@inheritDoc}

Details

at line 31
public __construct(array $violations = array())

Creates a new constraint violation list.

Parameters

array $violations The constraint violations to add to the list

at line 43
public string __toString()

Converts the violation into a string for debugging purposes.

Return Value

string The violation as string.

at line 57
public add(ConstraintViolationInterface $violation)

Adds a constraint violation to this list.

Parameters

ConstraintViolationInterface $violation The violation to add.

at line 65
public addAll(ConstraintViolationListInterface $otherList)

Merges an existing violation list into this list.

Parameters

ConstraintViolationListInterface $otherList The list to merge.

at line 75
public ConstraintViolationInterface get(integer $offset)

Returns the violation at a given offset.

Parameters

integer $offset The offset of the violation.

Return Value

ConstraintViolationInterface The violation.

Exceptions

OutOfBoundsException If the offset does not exist.

at line 87
public Boolean has(integer $offset)

Returns whether the given offset exists.

Parameters

integer $offset The violation offset.

Return Value

Boolean Whether the offset exists.

at line 95
public set(integer $offset, ConstraintViolationInterface $violation)

Sets a violation at a given offset.

Parameters

integer $offset The violation offset.
ConstraintViolationInterface $violation The violation.

at line 103
public remove(integer $offset)

Removes a violation at a given offset.

Parameters

integer $offset The offset to remove.

at line 111
public getIterator()

{@inheritDoc}

at line 119
public count()

{@inheritDoc}

at line 127
public offsetExists($offset)

{@inheritDoc}

Parameters

$offset

at line 135
public offsetGet($offset)

{@inheritDoc}

Parameters

$offset

at line 143
public offsetSet($offset, $violation)

{@inheritDoc}

Parameters

$offset
$violation

at line 155
public offsetUnset($offset)

{@inheritDoc}

Parameters

$offset