You are here

ProfileType.php in Commerce Migrate 8.2

File

modules/commerce/src/Plugin/migrate/source/commerce1/ProfileType.php
View source
<?php

namespace Drupal\commerce_migrate_commerce\Plugin\migrate\source\commerce1;

use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;

/**
 * Drupal 7 commerce_customer_profile source from database.
 *
 * @MigrateSource(
 *   id = "commerce1_profile_type",
 *   source_module = "commerce_customer"
 * )
 */
class ProfileType extends DrupalSqlBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this
      ->select('commerce_customer_profile', 'cp')
      ->fields('cp', [
      'type',
    ])
      ->distinct();
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      'type' => $this
        ->t('Type'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    $ids['type']['type'] = 'string';
    return $ids;
  }

}

Classes

Namesort descending Description
ProfileType Drupal 7 commerce_customer_profile source from database.