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\Core\Database\Query\SelectInterface; use Drupal\migrate\Plugin\migrate\source\SqlBase; /** * Migrate Source plugin. * * @MigrateSource( * id = "l10n_migrate_server_translation", * source_module = "l10n_migrate", * ) */ class L10nServerTranslation extends SqlBase { /** * {@inheritdoc} */ public function query(): SelectInterface { return $this ->select('l10n_server_translation', 't') ->fields( 't', [ 'tid', 'sid', 'language', 'translation', 'uid_entered', 'time_entered', 'time_changed', 'is_suggestion', 'is_active', ] ); } /** * {@inheritdoc} */ public function fields(): array { 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(): array { return [ 'tid' => [ 'type' => 'integer', 'alias' => 't', ], ]; } }