FormErrorIterator::key()

int key() Returns the current position of the iterator. Return Value int The 0-indexed position

FormErrorIterator::current()

FormError|FormErrorIterator current() Returns the current element of the iterator. Return Value FormError|FormErrorIterator An error or an iterator containing nested errors.

FormErrorIterator::getForm()

FormInterface getForm() Returns the iterated form. Return Value FormInterface The form whose errors are iterated by this object

FormErrorIterator::next()

next() Advances the iterator to the next position.

FormErrorIterator::offsetExists()

bool offsetExists(int $position) Returns whether a position exists in the iterator. Parameters int $position The position Return Value bool Whether that position exists

FormErrorIterator::hasChildren()

bool hasChildren() Returns whether the current element of the iterator can be recursed into. Return Value bool Whether the current element is an instance of this class

FormErrorIterator::getChildren()

getChildren() Alias of {@link current()}.

FormErrorIterator

class FormErrorIterator implements RecursiveIterator, SeekableIterator, ArrayAccess, Countable Iterates over the errors of a form. Optionally, this class supports recursive iteration. In order to iterate recursively, set the constructor argument $deep to true. Now each element returned by the iterator is either an instance of {@link FormError} or of {@link FormErrorIterator}, in case the errors belong to a sub-form. You can also wrap the iterator into a {@link \RecursiveIteratorIterator} to

FormErrorIterator::count()

int count() Returns the number of elements in the iterator. Note that this is not the total number of errors, if the constructor parameter $deep was set to true! In that case, you should wrap the iterator into a {@link \RecursiveIteratorIterator} with the standard mode {@link \RecursiveIteratorIterator::LEAVES_ONLY} and count the result. $iterator = new \RecursiveIteratorIterator($form->getErrors(true)); $count = count(iterator_to_array($iterator)); Alternatively, set the con

FormError::unserialize()

unserialize(string $serialized) Unserializes a serialized error. Parameters string $serialized The serialized error