You are here

public function SensorAsset::prepareRow in farmOS 2.x

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 FarmAsset::prepareRow

File

modules/core/migrate/src/Plugin/migrate/source/d7/SensorAsset.php, line 55

Class

SensorAsset
Migration source for the d7 sensor asset.

Namespace

Drupal\farm_migrate\Plugin\migrate\source\d7

Code

public function prepareRow(Row $row) {

  // Get the sensor_settings field.
  $settings = $row
    ->getSourceProperty('sensor_settings');
  if (!empty($settings)) {

    // Unserialize the sensor_settings field.
    $settings_array = unserialize($settings);

    // Re-set the source property value.
    $row
      ->setSourceProperty('sensor_settings', $settings_array);
  }
  return parent::prepareRow($row);
}