You are here

public function MigrateDestinationCommerceProductType::prepareRollback in Commerce Migrate 7

Give handlers a shot at cleaning up before a product type has been rolled back.

Parameters

$product_type: Machine name of the product type about to be deleted..

1 call to MigrateDestinationCommerceProductType::prepareRollback()
MigrateDestinationCommerceProductType::rollback in plugins/destinations/commerce_product_type.inc
Delete a product type.

File

plugins/destinations/commerce_product_type.inc, line 126
Support for commerce product types.

Class

MigrateDestinationCommerceProductType
Destination class implementing migration into commerce product types.

Code

public function prepareRollback($product_type) {
  $migration = Migration::currentMigration();
  $entity->migrate = array(
    'machineName' => $migration
      ->getMachineName(),
  );

  // Then call any prepare handler for this specific Migration.
  if (method_exists($migration, 'prepareRollback')) {
    $migration
      ->prepareRollback($product_type);
  }
}