You are here

public function CommerceExampleOrderMigration::createStub in Commerce Migrate 7

See also

Migration::createStubWrapper()

File

commerce_migrate_example/migrations/order.inc, line 56
Import orders and attach line items with products to them.

Class

CommerceExampleOrderMigration
Class CommerceExampleOrderMigration.

Code

public function createStub(Migration $migration, array $source_id) {
  $order = entity_create($this->destination
    ->getEntityType(), array(
    'uid' => 0,
    'mail' => 'stub-order@example.com',
    'status' => 'pending',
    'order_number' => 'STUB-' . implode('-', $source_id),
  ));
  commerce_order_save($order);
  return isset($order->order_id) ? array(
    $order->order_id,
    $order->revision_id,
  ) : FALSE;
}