You are here

AgreementType.php in Agreement 8.2

Same filename and directory in other branches
  1. 3.0.x src/Plugin/migrate/source/d7/AgreementType.php

File

src/Plugin/migrate/source/d7/AgreementType.php
View source
<?php

namespace Drupal\agreement\Plugin\migrate\source\d7;

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

/**
 * Agreement type migrate source plugin.
 *
 * @MigrateSource(
 *   id = "agreement_type",
 *   source_module = "agreement"
 * )
 */
class AgreementType extends DrupalSqlBase {

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      'name' => $this
        ->t('Unique name'),
      'type' => $this
        ->t('Label'),
      'path' => $this
        ->t('Path'),
      'settings' => $this
        ->t('Settings'),
      'agreement' => $this
        ->t('Agreement'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    return [
      'name' => [
        'type' => 'string',
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function query() {
    return $this
      ->select('agreement_type', 'agreement_type')
      ->fields('agreement_type', [
      'name',
      'type',
      'path',
      'settings',
      'agreement',
    ]);
  }

}

Classes

Namesort descending Description
AgreementType Agreement type migrate source plugin.