You are here

public function ErrorCollection::getIterator in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php \Drupal\jsonapi\JsonApiResource\ErrorCollection::getIterator()

Returns an iterator for errors.

Return value

\ArrayIterator An \ArrayIterator instance

File

core/modules/jsonapi/src/JsonApiResource/ErrorCollection.php, line 50

Class

ErrorCollection
To be used when the primary data is `errors`.

Namespace

Drupal\jsonapi\JsonApiResource

Code

public function getIterator() {
  return new \ArrayIterator($this->errors);
}