public function Message::prepareRow in Commerce Migrate 3.1.x
Same name and namespace in other branches
- 8.2 modules/commerce/src/Plugin/migrate/source/commerce1/Message.php \Drupal\commerce_migrate_commerce\Plugin\migrate\source\commerce1\Message::prepareRow()
- 3.0.x modules/commerce/src/Plugin/migrate/source/commerce1/Message.php \Drupal\commerce_migrate_commerce\Plugin\migrate\source\commerce1\Message::prepareRow()
Adds additional data to the row.
Parameters
\Drupal\migrate\Row $row: The row object.
Return value
bool FALSE if this row needs to be skipped.
Overrides SourcePluginBase::prepareRow
File
- modules/
commerce/ src/ Plugin/ migrate/ source/ commerce1/ Message.php, line 32
Class
- Message
- Gets the Commerce 1 currency data.
Namespace
Drupal\commerce_migrate_commerce\Plugin\migrate\source\commerce1Code
public function prepareRow(Row $row) {
// Get Field API field values.
$mid = $row
->getSourceProperty('mid');
foreach (array_keys($this
->getFields('message', $row
->getSourceProperty('type'))) as $field) {
$row
->setSourceProperty($field, $this
->getFieldValues('message', $field, $mid));
}
$order_ref = $row
->getSourceProperty('message_commerce_order');
$row
->setSourceProperty('target_id', $order_ref[0]['target_id']);
return parent::prepareRow($row);
}