Class

Symfony\Component\Validator\ConstraintViolationList

class ConstraintViolationList implements IteratorAggregate, Countable, ArrayAccess

A list of ConstrainViolation objects.

Methods

__construct(array $violations = array())

Creates a new constraint violation list.

string __toString()

add(ConstraintViolation $violation)

Add a ConstraintViolation to this list.

addAll(ConstraintViolationList $otherList)

Merge an existing ConstraintViolationList into this list.

ConstraintViolation get(integer $offset)

Returns the violation at a given offset.

Boolean has(integer $offset)

Returns whether the given offset exists.

set(integer $offset, ConstraintViolation $violation)

Sets a violation at a given offset.

remove(integer $offset)

Removes a violation at a given offset.

getIterator()

count()

offsetExists($offset)

offsetGet($offset)

offsetSet($offset, $violation)

offsetUnset($offset)

Details

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

Creates a new constraint violation list.

Parameters

array $violations The constraint violations to add to the list

at line 45
public string __toString()

Return Value

string

at line 63
public add(ConstraintViolation $violation)

Add a ConstraintViolation to this list.

Parameters

ConstraintViolation $violation

at line 75
public addAll(ConstraintViolationList $otherList)

Merge an existing ConstraintViolationList into this list.

Parameters

ConstraintViolationList $otherList

at line 91
public ConstraintViolation get(integer $offset)

Returns the violation at a given offset.

Parameters

integer $offset The offset of the violation.

Return Value

ConstraintViolation The violation.

Exceptions

OutOfBoundsException If the offset does not exist.

at line 107
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 118
public set(integer $offset, ConstraintViolation $violation)

Sets a violation at a given offset.

Parameters

integer $offset The violation offset.
ConstraintViolation $violation The violation.

at line 128
public remove(integer $offset)

Removes a violation at a given offset.

Parameters

integer $offset The offset to remove.

at line 138
public getIterator()

See also

IteratorAggregate

at line 148
public count()

See also

Countable

at line 158
public offsetExists($offset)

Parameters

$offset

See also

ArrayAccess

at line 168
public offsetGet($offset)

Parameters

$offset

See also

ArrayAccess

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

Parameters

$offset
$violation

See also

ArrayAccess

at line 192
public offsetUnset($offset)

Parameters

$offset

See also

ArrayAccess