Documentation

ConstraintViolationList
in package
implements IteratorAggregate, ConstraintViolationListInterface

Default implementation of {@ConstraintViolationListInterface}.

Tags
author

Bernhard Schussek bschussek@gmail.com

implements

\IteratorAggregate<int, ConstraintViolationInterface>

Table of Contents

Interfaces

IteratorAggregate
ConstraintViolationListInterface
A list of constraint violations.

Properties

$violations  : array<int, ConstraintViolationInterface>

Methods

__construct()  : mixed
Creates a new constraint violation list.
__toString()  : string
Converts the violation into a string for debugging purposes.
add()  : mixed
Adds a constraint violation to this list.
addAll()  : mixed
Merges an existing violation list into this list.
count()  : int
createFromMessage()  : self
findByCodes()  : static
Creates iterator for errors with specific codes.
get()  : ConstraintViolationInterface
Returns the violation at a given offset.
getIterator()  : ArrayIterator<int, ConstraintViolationInterface>
{@inheritdoc}
has()  : bool
Returns whether the given offset exists.
offsetExists()  : bool
offsetGet()  : ConstraintViolationInterface
offsetSet()  : void
offsetUnset()  : void
remove()  : mixed
Removes a violation at a given offset.
set()  : mixed
Sets a violation at a given offset.

Properties

Methods

__toString()

Converts the violation into a string for debugging purposes.

public __toString() : string
Return values
string

createFromMessage()

public static createFromMessage(string $message) : self
Parameters
$message : string
Return values
self

findByCodes()

Creates iterator for errors with specific codes.

public findByCodes(string|array<string|int, string> $codes) : static
Parameters
$codes : string|array<string|int, string>

The codes to find

Return values
static

has()

Returns whether the given offset exists.

public has(int $offset) : bool
Parameters
$offset : int

The violation offset

Return values
bool

offsetExists()

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetSet()

public offsetSet(mixed $offset, mixed $violation) : void
Parameters
$offset : mixed
$violation : mixed

remove()

Removes a violation at a given offset.

public remove(int $offset) : mixed
Parameters
$offset : int

The offset to remove


        
On this page

Search results