l10n_server-2.x-dev/l10n_migrate/src/Plugin/migrate/source/L10nServerStatusFlag.php
l10n_migrate/src/Plugin/migrate/source/L10nServerStatusFlag.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_status_flag", * source_module = "l10n_migrate", * ) */ class L10nServerStatusFlag extends SqlBase { /** * {@inheritdoc} */ public function query(): SelectInterface { return $this ->select('l10n_server_status_flag', 's') ->fields( 's', [ 'sid', 'language', 'has_suggestion', 'has_translation', ] ); } /** * {@inheritdoc} */ public function fields(): array { return [ 'sid' => $this->t('Status Flag ID'), 'language' => $this->t('Language'), 'has_suggestion' => $this->t('Has suggestion'), 'has_translation' => $this->t('Has translation'), ]; } /** * {@inheritdoc} */ public function getIds(): array { return [ 'sid' => [ 'type' => 'integer', 'alias' => 's', ], 'language' => [ 'type' => 'string', 'alias' => 's', ], ]; } }