protected function PrepareRow::setEntityType in Commerce Migrate 8.2
Same name and namespace in other branches
- 3.1.x modules/ubercart/src/EventSubscriber/PrepareRow.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PrepareRow::setEntityType()
- 3.0.x modules/ubercart/src/EventSubscriber/PrepareRow.php \Drupal\commerce_migrate_ubercart\EventSubscriber\PrepareRow::setEntityType()
Helper to set the correct entity type in the source row.
Parameters
\Drupal\migrate\Row $row: The row object.
\Drupal\migrate\Plugin\MigrationInterface $migration: The migration.
string $type_name: The type name.
1 call to PrepareRow::setEntityType()
- PrepareRow::onPrepareRow in modules/
ubercart/ src/ EventSubscriber/ PrepareRow.php - Responds to prepare row event.
File
- modules/
ubercart/ src/ EventSubscriber/ PrepareRow.php, line 196
Class
- PrepareRow
- Handles migrate_plus prepare row event.
Namespace
Drupal\commerce_migrate_ubercart\EventSubscriberCode
protected function setEntityType(Row $row, MigrationInterface $migration, $type_name) {
if ($this->productTypes == []) {
$this->productTypes = $this
->getProductTypes($migration);
}
if (in_array($type_name, $this->productTypes)) {
$row
->setSourceProperty('entity_type', 'commerce_product');
return TRUE;
}
return FALSE;
}