l10n_server-2.x-dev/l10n_migrate/src/Plugin/migrate/source/L10nServerTranslation.php

l10n_migrate/src/Plugin/migrate/source/L10nServerTranslation.php
<?php
declare(strict_types=1);

namespace Drupal\l10n_migrate\Plugin\migrate\source;

use Drupal\migrate\Plugin\migrate\source\SqlBase;
use Drupal\migrate\Row;

/**
 * Migrate Source plugin.
 *
 * @MigrateSource(
 *   id = "l10n_migrate_server_translation",
 *   source_module = "l10n_migrate",
 * )
 */
class L10nServerTranslation extends SqlBase {

  /**
   * {@inheritdoc}
   */
  public function query() {
    $query = $this
      ->select('l10n_server_translation', 't')
      ->fields('t', [
        'tid', 'sid', 'language', 'translation', 'uid_entered', 'time_entered', 'time_changed', 'is_suggestion', 'is_active',
      ]);
    return $query;
  }

  /**
   * {@inheritdoc}
   */
  public function fields() {
    return [
      'tid' => $this->t('Translation ID'),
      'sid' => $this->t('String ID'),
      'language' => $this->t('Language'),
      'translation' => $this->t('Translation'),
      'uid_entered' => $this->t('User ID entered'),
      'time_entered' => $this->t('Time entered'),
      'time_changed' => $this->t('Time changed'),
      'is_suggestion' => $this->t('Is suggestion'),
      'is_active' => $this->t('Is active'),
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getIds() {
    return [
      'tid' => [
        'type' => 'integer',
        'alias' => 't',
      ],
    ];
  }

  /**
   * {@inheritdoc}
   */
  // phpcs:ignore
  public function prepareRow(Row $row) {
    return parent::prepareRow($row);
  }

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc