protected function ContactSettings::initializeIterator in Drupal 10
Same name and namespace in other branches
- 8 core/modules/contact/src/Plugin/migrate/source/ContactSettings.php \Drupal\contact\Plugin\migrate\source\ContactSettings::initializeIterator()
- 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 iterable object of data for this source.
Overrides Variable::initializeIterator
File
- core/
modules/ contact/ src/ Plugin/ migrate/ source/ ContactSettings.php, line 25
Class
- ContactSettings
- Drupal 6/7 contact settings source from database.
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,
],
]);
}