function Data::getIterator

Same name in other branches
  1. 8.9.x core/modules/jsonapi/src/JsonApiResource/Data.php \Drupal\jsonapi\JsonApiResource\Data::getIterator()
  2. 10 core/modules/jsonapi/src/JsonApiResource/Data.php \Drupal\jsonapi\JsonApiResource\Data::getIterator()
  3. 11.x core/modules/jsonapi/src/JsonApiResource/Data.php \Drupal\jsonapi\JsonApiResource\Data::getIterator()

Returns an iterator for entities.

Return value

\ArrayIterator An \ArrayIterator instance

File

core/modules/jsonapi/src/JsonApiResource/Data.php, line 72

Class

Data
Represents the `data` and `included` objects of a top-level object.

Namespace

Drupal\jsonapi\JsonApiResource

Code

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

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.