You are here

public function CommerceKickstartNode::prepareRow in Commerce Kickstart 7.2

Same name in this branch
  1. 7.2 modules/commerce_kickstart/commerce_kickstart_product/commerce_kickstart_product.migrate.inc \CommerceKickstartNode::prepareRow()
  2. 7.2 modules/commerce_kickstart/commerce_kickstart_lite_product/commerce_kickstart_lite_product.migrate.inc \CommerceKickstartNode::prepareRow()

Default implementation of prepareRow(). This method is called from the source plugin upon first pulling the raw data from the source.

Parameters

$row: Object containing raw source data.

Return value

bool TRUE to process this row, FALSE to have the source skip it.

Overrides Migration::prepareRow

File

modules/commerce_kickstart/commerce_kickstart_product/commerce_kickstart_product.migrate.inc, line 641
Migrations for commerce_kickstart_product.

Class

CommerceKickstartNode
Class CommerceKickstartNode.

Code

public function prepareRow($row) {
  $products = array();
  foreach (explode(', ', $row->sku) as $sku) {
    $product = commerce_product_load_by_sku($sku);
    $products[] = $product->product_id;
  }
  $row->skus = $products;
}