You are here

public function ProductVariation::prepareRow in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x modules/csv_example/src/Plugin/migrate/source/ProductVariation.php \Drupal\commerce_migrate_csv_example\Plugin\migrate\source\ProductVariation::prepareRow()
  2. 3.0.x modules/csv_example/src/Plugin/migrate/source/ProductVariation.php \Drupal\commerce_migrate_csv_example\Plugin\migrate\source\ProductVariation::prepareRow()

File

modules/csv_example/src/Plugin/migrate/source/ProductVariation.php, line 22

Class

ProductVariation
Gets the product variations rows.

Namespace

Drupal\commerce_migrate_csv_example\Plugin\migrate\source

Code

public function prepareRow(Row $row) {

  // Trim all the source values.
  foreach ($row
    ->getSource() as $key => $value) {
    if (is_string($value)) {
      $row
        ->setSourceProperty($key, trim($value));
    }
  }
  return parent::prepareRow($row);
}