You are here

public function FieldGroup::prepareRow in Field Group 8

Same name in this branch
  1. 8 contrib/field_group_migrate/src/Plugin/migrate/source/d6/FieldGroup.php \Drupal\field_group_migrate\Plugin\migrate\source\d6\FieldGroup::prepareRow()
  2. 8 contrib/field_group_migrate/src/Plugin/migrate/source/d7/FieldGroup.php \Drupal\field_group_migrate\Plugin\migrate\source\d7\FieldGroup::prepareRow()
Same name and namespace in other branches
  1. 8.3 contrib/field_group_migrate/src/Plugin/migrate/source/d6/FieldGroup.php \Drupal\field_group_migrate\Plugin\migrate\source\d6\FieldGroup::prepareRow()

Adds additional data to the row.

Parameters

\Drupal\migrate\Row $row: The row object.

Return value

bool FALSE if this row needs to be skipped.

Overrides SourcePluginBase::prepareRow

File

contrib/field_group_migrate/src/Plugin/migrate/source/d6/FieldGroup.php, line 36

Class

FieldGroup
Drupal 6 field_group source.

Namespace

Drupal\field_group_migrate\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {
  $query = $this
    ->select('content_group_fields', 'f');
  $query
    ->fields('f', [
    'field_name',
  ])
    ->condition('type_name', $row
    ->getSourceProperty('type_name'))
    ->condition('group_name', $row
    ->getSourceProperty('group_name'));
  $fields = $query
    ->execute()
    ->fetchCol();
  $row
    ->setSourceProperty('children', $fields);
  $row
    ->setSourceProperty('settings', unserialize($row
    ->getSourceProperty('settings')));
  switch ($row
    ->getSourceProperty('constants/mode')) {
    case 'entity_form_display':
      $this
        ->transformEntityFormDisplaySettings($row);
      break;
    case 'entity_view_display':
      $this
        ->transformEntityViewDisplaySettings($row);
      break;
  }
  return parent::prepareRow($row);
}