You are here

class Magento in Commerce Migrate 3.0.x

Same name and namespace in other branches
  1. 8.2 modules/magento/src/Plugin/migrate/source/magento2/Magento.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\Magento
  2. 3.1.x modules/magento/src/Plugin/migrate/source/magento2/Magento.php \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\Magento

Gets the destination site default language.

Plugin annotation


@MigrateSource(
  id = "magento2_csv"
)

Hierarchy

  • class \Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2\Magento extends \Drupal\migrate_source_csv\Plugin\migrate\source\CSV

Expanded class hierarchy of Magento

File

modules/magento/src/Plugin/migrate/source/magento2/Magento.php, line 15

Namespace

Drupal\commerce_migrate_magento\Plugin\migrate\source\magento2
View source
class Magento extends CSV {

  /**
   * {@inheritdoc}
   */
  public function prepareRow(Row $row) {

    // Get the destination site default language.
    $language = \Drupal::languageManager()
      ->getDefaultLanguage()
      ->getId();
    $row
      ->setSourceProperty('destination_default_langcode', $language);
    return parent::prepareRow($row);
  }

}

Members