TaxType.php in Commerce Migrate 8.2        
                          
                  
                        
  
  
  
  
File
  modules/commerce/src/Plugin/migrate/source/commerce1/TaxType.php
  
    View source  
  <?php
namespace Drupal\commerce_migrate_commerce\Plugin\migrate\source\commerce1;
use Drupal\migrate\Row;
use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
class TaxType extends DrupalSqlBase {
  
  public function query() {
    return $this
      ->select('commerce_tax_rate', 'ctr')
      ->fields('ctr');
  }
  
  public function fields() {
    return [
      'name' => $this
        ->t('TaxType Name'),
      'title' => $this
        ->t('Title'),
      'display_title' => $this
        ->t('Display title'),
      'description' => $this
        ->t('Description'),
      'display_inclusive' => $this
        ->t('Display inclusive'),
      'rate' => $this
        ->t('TaxType Rate'),
      'type' => $this
        ->t('Tax type'),
      'default_rules_component' => $this
        ->t('Default rules component'),
      'module' => $this
        ->t('Module'),
    ];
  }
  
  public function prepareRow(Row $row) {
    
    $row
      ->setSourceProperty('default_country', $this
      ->variableGet('site_default_country', NULL));
  }
  
  public function getIds() {
    $ids['name']['type'] = 'string';
    return $ids;
  }
}
 
Classes
        
  
  
      
      
         
      
                  | Name   | Description | 
    
    
          
                  | TaxType | Gets Commerce 1 commerce_tax_type data from database. |