function EntityAdapter::getIterator

Same name in other branches
  1. 9 core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getIterator()
  2. 8.9.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getIterator()
  3. 11.x core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php \Drupal\Core\Entity\Plugin\DataType\EntityAdapter::getIterator()
1 method overrides EntityAdapter::getIterator()
ConfigEntityAdapter::getIterator in core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php

File

core/lib/Drupal/Core/Entity/Plugin/DataType/EntityAdapter.php, line 165

Class

EntityAdapter
Defines the "entity" data type.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

public function getIterator() {
    return $this->entity instanceof \IteratorAggregate ? $this->entity
        ->getIterator() : new \ArrayIterator([]);
}

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