You are here

public function FieldInstance::prepareRow in Drupal 8

Same name in this branch
  1. 8 core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php \Drupal\field\Plugin\migrate\source\d6\FieldInstance::prepareRow()
  2. 8 core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php \Drupal\field\Plugin\migrate\source\d7\FieldInstance::prepareRow()
Same name and namespace in other branches
  1. 9 core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php \Drupal\field\Plugin\migrate\source\d6\FieldInstance::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

core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php, line 56

Class

FieldInstance
Drupal 6 field instances source from database.

Namespace

Drupal\field\Plugin\migrate\source\d6

Code

public function prepareRow(Row $row) {

  // Unserialize data.
  $widget_settings = unserialize($row
    ->getSourceProperty('widget_settings'));
  $display_settings = unserialize($row
    ->getSourceProperty('display_settings'));
  $global_settings = unserialize($row
    ->getSourceProperty('global_settings'));
  $row
    ->setSourceProperty('widget_settings', $widget_settings);
  $row
    ->setSourceProperty('display_settings', $display_settings);
  $row
    ->setSourceProperty('global_settings', $global_settings);

  // Determine the translatable setting.
  $translatable = TRUE;
  $synchronized_fields = $this
    ->variableGet('i18nsync_nodeapi_' . $row
    ->getSourceProperty('type_name'), NULL);
  if ($synchronized_fields) {
    if (in_array($row
      ->getSourceProperty('field_name'), $synchronized_fields)) {
      $translatable = FALSE;
    }
  }
  $row
    ->setSourceProperty('translatable', $translatable);
  return parent::prepareRow($row);
}