function FieldInstance::prepareRow

Same name in this branch
  1. 10 core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php \Drupal\field\Plugin\migrate\source\d7\FieldInstance::prepareRow()
Same name in other branches
  1. 9 core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php \Drupal\field\Plugin\migrate\source\d6\FieldInstance::prepareRow()
  2. 9 core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php \Drupal\field\Plugin\migrate\source\d7\FieldInstance::prepareRow()
  3. 8.9.x core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php \Drupal\field\Plugin\migrate\source\d6\FieldInstance::prepareRow()
  4. 8.9.x core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php \Drupal\field\Plugin\migrate\source\d7\FieldInstance::prepareRow()
  5. 11.x core/modules/field/src/Plugin/migrate/source/d6/FieldInstance.php \Drupal\field\Plugin\migrate\source\d6\FieldInstance::prepareRow()
  6. 11.x core/modules/field/src/Plugin/migrate/source/d7/FieldInstance.php \Drupal\field\Plugin\migrate\source\d7\FieldInstance::prepareRow()

Overrides SourcePluginBase::prepareRow

File

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

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

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