function ContactSettings::initializeIterator

Same name in other branches
  1. 9 core/modules/contact/src/Plugin/migrate/source/ContactSettings.php \Drupal\contact\Plugin\migrate\source\ContactSettings::initializeIterator()
  2. 10 core/modules/contact/src/Plugin/migrate/source/ContactSettings.php \Drupal\contact\Plugin\migrate\source\ContactSettings::initializeIterator()
  3. 11.x core/modules/contact/src/Plugin/migrate/source/ContactSettings.php \Drupal\contact\Plugin\migrate\source\ContactSettings::initializeIterator()

Overrides Variable::initializeIterator

File

core/modules/contact/src/Plugin/migrate/source/ContactSettings.php, line 18

Class

ContactSettings
Plugin annotation @MigrateSource( id = "contact_settings", source_module = "contact" )

Namespace

Drupal\contact\Plugin\migrate\source

Code

protected function initializeIterator() {
    $default_category = $this->select('contact', 'c')
        ->fields('c', [
        'cid',
    ])
        ->condition('c.selected', 1)
        ->execute()
        ->fetchField();
    return new \ArrayIterator([
        $this->values() + [
            'default_category' => $default_category,
        ],
    ]);
}

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