You are here

public function TaxTypeBase::prepareRow in Commerce Migrate 8.2

Same name and namespace in other branches
  1. 3.1.x modules/ubercart/src/Plugin/migrate/source/TaxTypeBase.php \Drupal\commerce_migrate_ubercart\Plugin\migrate\source\TaxTypeBase::prepareRow()
  2. 3.0.x modules/ubercart/src/Plugin/migrate/source/TaxTypeBase.php \Drupal\commerce_migrate_ubercart\Plugin\migrate\source\TaxTypeBase::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/ubercart/src/Plugin/migrate/source/TaxTypeBase.php, line 39

Class

TaxTypeBase
Base class for Ubercart tax type source plugins.

Namespace

Drupal\commerce_migrate_ubercart\Plugin\migrate\source

Code

public function prepareRow(Row $row) {
  $row
    ->setSourceProperty('taxed_product_types', unserialize($row
    ->getSourceProperty('taxed_product_types')));
  $row
    ->setSourceProperty('taxed_line_items', unserialize($row
    ->getSourceProperty('taxed_line_items')));
  $country = $this
    ->variableGet('uc_store_country', NULL);

  // Get the country iso code 2 for this country.
  $query = $this
    ->select('uc_countries', 'ucc')
    ->fields('ucc', [
    'country_iso_code_2',
  ])
    ->condition('country_id', $country);
  $country_iso_code_2 = $query
    ->execute()
    ->fetchField();
  $row
    ->setSourceProperty('country_iso_code_2', $country_iso_code_2);
  return parent::prepareRow($row);
}