function FieldInstancePerFormDisplay::initializeIterator

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

Overrides SqlBase::initializeIterator

File

core/modules/field/src/Plugin/migrate/source/d6/FieldInstancePerFormDisplay.php, line 20

Class

FieldInstancePerFormDisplay
The field instance per form display source class.

Namespace

Drupal\field\Plugin\migrate\source\d6

Code

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);
}

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