You are here

protected function Variable::initializeIterator in Drupal 9

Same name and namespace in other branches
  1. 8 core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php \Drupal\migrate_drupal\Plugin\migrate\source\Variable::initializeIterator()

Initializes the iterator with the source data.

Return value

\Iterator Returns an iterable object of data for this source.

Overrides SqlBase::initializeIterator

2 methods override Variable::initializeIterator()
ContactSettings::initializeIterator in core/modules/contact/src/Plugin/migrate/source/ContactSettings.php
Initializes the iterator with the source data.
SearchPage::initializeIterator in core/modules/search/src/Plugin/migrate/source/d7/SearchPage.php
Initializes the iterator with the source data.

File

core/modules/migrate_drupal/src/Plugin/migrate/source/Variable.php, line 111

Class

Variable
Drupal variable source from database.

Namespace

Drupal\migrate_drupal\Plugin\migrate\source

Code

protected function initializeIterator() {
  if ($this
    ->count()) {
    return new \ArrayIterator([
      $this
        ->values(),
    ]);
  }
  return new \ArrayIterator();
}