protected function FieldInstancePerFormDisplay::initializeIterator in Drupal 10
Same name and namespace in other branches
- 8 core/modules/field/src/Plugin/migrate/source/d6/FieldInstancePerFormDisplay.php \Drupal\field\Plugin\migrate\source\d6\FieldInstancePerFormDisplay::initializeIterator()
- 9 core/modules/field/src/Plugin/migrate/source/d6/FieldInstancePerFormDisplay.php \Drupal\field\Plugin\migrate\source\d6\FieldInstancePerFormDisplay::initializeIterator()
Initializes the iterator with the source data.
Return value
\Iterator Returns an iterable object of data for this source.
Overrides SqlBase::initializeIterator
File
- core/
modules/ field/ src/ Plugin/ migrate/ source/ d6/ FieldInstancePerFormDisplay.php, line 25
Class
- FieldInstancePerFormDisplay
- Drupal 6 field instance per form display source from database.
Namespace
Drupal\field\Plugin\migrate\source\d6Code
protected function initializeIterator() {
$rows = [];
$result = $this
->prepareQuery()
->execute();
while ($field_row = $result
->fetchAssoc()) {
$bundle = $field_row['type_name'];
$field_name = $field_row['field_name'];
$index = "{$bundle}.{$field_name}";
$rows[$index]['type_name'] = $bundle;
$rows[$index]['widget_active'] = (bool) $field_row['widget_active'];
$rows[$index]['field_name'] = $field_name;
$rows[$index]['type'] = $field_row['type'];
$rows[$index]['module'] = $field_row['module'];
$rows[$index]['weight'] = $field_row['weight'];
$rows[$index]['widget_type'] = $field_row['widget_type'];
$rows[$index]['widget_settings'] = unserialize($field_row['widget_settings']);
$rows[$index]['display_settings'] = unserialize($field_row['display_settings']);
}
return new \ArrayIterator($rows);
}