DefaultCommerceStore.php in Commerce Migrate 3.1.x
File
src/Plugin/migrate/destination/DefaultCommerceStore.php
View source
<?php
namespace Drupal\commerce_migrate\Plugin\migrate\destination;
use Drupal\migrate\Row;
use Drupal\migrate\Plugin\migrate\destination\Config;
use Drupal\commerce_store\Entity\Store;
class DefaultCommerceStore extends Config {
public function import(Row $row, array $old_destination_id_values = []) {
$destination = $row
->getDestination();
$store_id = $destination['id'];
$store = Store::load($store_id);
$this->config
->set('default_store', $store
->uuid());
$this->config
->save();
return [
$this->config
->getName(),
];
}
}