function ConfigEntityAdapter::getIterator

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

Overrides EntityAdapter::getIterator

File

core/lib/Drupal/Core/Entity/Plugin/DataType/ConfigEntityAdapter.php, line 72

Class

ConfigEntityAdapter
Enhances EntityAdapter for config entities.

Namespace

Drupal\Core\Entity\Plugin\DataType

Code

public function getIterator() {
    if (isset($this->entity)) {
        return $this->getConfigTypedData()
            ->getIterator();
    }
    return new \ArrayIterator([]);
}

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