You are here

public function CommerceExampleOrderMigration::prepare in Commerce Migrate 7

See also

MigrateDestinationEntity::prepare()

File

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

Class

CommerceExampleOrderMigration
Class CommerceExampleOrderMigration.

Code

public function prepare(stdClass $entity, stdClass $row) {
  $order_id = db_select('commerce_order', 'co')
    ->fields('co', array(
    'order_id',
  ))
    ->condition('order_number', $row->order_number)
    ->execute()
    ->fetchField();
  $entity->commerce_line_items[LANGUAGE_NONE] = self::seekLineItems($order_id);
}