ShippingFlatRate.php in Commerce Migrate 8.2
File
modules/ubercart/src/Plugin/migrate/source/ShippingFlatRate.php
View source
<?php
namespace Drupal\commerce_migrate_ubercart\Plugin\migrate\source;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class ShippingFlatRate extends DrupalSqlBase {
public function query() {
return $this
->select('uc_flatrate_methods', 'f')
->fields('f');
}
public function fields() {
return [
'mid' => t('Method id'),
'title' => t('Flat rate title'),
'label' => t('Flat rate label'),
'base_rate' => t('Base rate'),
'product_rate' => t('Product rate'),
'currency_code' => t('Currency code'),
];
}
public function prepareRow(Row $row) {
$currency_code = $this
->variableGet('currency_code', 'USD');
$row
->setSourceProperty('currency_code', $currency_code);
return parent::prepareRow($row);
}
public function getIds() {
return [
'mid' => [
'type' => 'integer',
],
];
}
}