public function DefaultCommerceStore::import in Commerce Migrate 3.0.x
Same name and namespace in other branches
- 8.2 src/Plugin/migrate/destination/DefaultCommerceStore.php \Drupal\commerce_migrate\Plugin\migrate\destination\DefaultCommerceStore::import()
- 3.1.x src/Plugin/migrate/destination/DefaultCommerceStore.php \Drupal\commerce_migrate\Plugin\migrate\destination\DefaultCommerceStore::import()
Import the row.
Derived classes must implement import(), to construct one new object (pre-populated) using ID mappings in the Migration.
Parameters
\Drupal\migrate\Row $row: The row object.
array $old_destination_id_values: (optional) The old destination IDs. Defaults to an empty array.
Return value
array|bool An indexed array of destination IDs in the same order as defined in the plugin's getIds() method if the plugin wants to save the IDs to the ID map, TRUE to indicate success without saving IDs to the ID map, or FALSE to indicate a failure.
Overrides Config::import
File
- src/
Plugin/ migrate/ destination/ DefaultCommerceStore.php, line 21
Class
- DefaultCommerceStore
- Saves store settings.
Namespace
Drupal\commerce_migrate\Plugin\migrate\destinationCode
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(),
];
}