CommerceProductType.php in Commerce Migrate 8.2
Same filename and directory in other branches
File
src/Plugin/migrate/destination/CommerceProductType.phpView source
<?php
namespace Drupal\commerce_migrate\Plugin\migrate\destination;
use Drupal\commerce_product\Entity\ProductType;
use Drupal\migrate\Plugin\migrate\destination\EntityConfigBase;
use Drupal\migrate\Row;
/**
* Migrate destination for commerce product type.
*
* If the product type save is successful, add the 3 required fields, stores,
* body and variation.
*
* @MigrateDestination(
* id = "entity:commerce_product_type"
* )
*/
class CommerceProductType extends EntityConfigBase {
/**
* {@inheritdoc}
*/
public function import(Row $row, array $old_destination_id_values = []) {
if ($ret = parent::import($row, $old_destination_id_values)) {
$product_type = ProductType::load($row
->getDestinationProperty('id'));
commerce_product_add_body_field($product_type);
}
return $ret;
}
}
Classes
Name![]() |
Description |
---|---|
CommerceProductType | Migrate destination for commerce product type. |