DefaultCommerceStore.php in Commerce Migrate 8.2
Same filename and directory in other branches
File
src/Plugin/migrate/destination/DefaultCommerceStore.phpView 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;
/**
* Saves store settings.
*
* @MigrateDestination(
* id = "default_commerce_store"
* )
*/
class DefaultCommerceStore extends Config {
/**
* {@inheritdoc}
*/
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(),
];
}
}
Classes
Name | Description |
---|---|
DefaultCommerceStore | Saves store settings. |