protected function ContactSettings::initializeIterator in Drupal 8
Same name and namespace in other branches
- 9 core/modules/contact/src/Plugin/migrate/source/ContactSettings.php \Drupal\contact\Plugin\migrate\source\ContactSettings::initializeIterator()
Initializes the iterator with the source data.
Return value
\Iterator Returns an iteratable object of data for this source.
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\sourceCode
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,
],
]);
}