ProductVariation.php in Commerce Migrate 3.0.x
File
modules/csv_example/src/Plugin/migrate/source/ProductVariation.php
View source
<?php
namespace Drupal\commerce_migrate_csv_example\Plugin\migrate\source;
use Drupal\migrate\Row;
use Drupal\migrate_source_csv\Plugin\migrate\source\CSV;
class ProductVariation extends CSV {
public function prepareRow(Row $row) {
foreach ($row
->getSource() as $key => $value) {
if (is_string($value)) {
$row
->setSourceProperty($key, trim($value));
}
}
return parent::prepareRow($row);
}
}