DomainRecord.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. namespace Drupal\domain\Plugin\migrate\source\d7;
  3. use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
  4. /**
  5. * Drupal 7 Domain source from database.
  6. *
  7. * @MigrateSource(
  8. * id = "d7_domain",
  9. * source_module = "domain"
  10. * )
  11. */
  12. class DomainRecord extends DrupalSqlBase {
  13. /**
  14. * {@inheritdoc}
  15. */
  16. public function query() {
  17. $fields = [
  18. 'domain_id',
  19. 'subdomain',
  20. 'sitename',
  21. 'scheme',
  22. 'valid',
  23. 'weight',
  24. 'is_default',
  25. 'machine_name',
  26. ];
  27. return $this->select('domain', 'd')->fields('d', $fields);
  28. }
  29. /**
  30. * {@inheritdoc}
  31. */
  32. public function fields() {
  33. return [
  34. 'domain_id' => $this->t('Domain ID.'),
  35. 'subdomain' => $this->t('Subdomain.'),
  36. 'sitename' => $this->t('Sitename.'),
  37. 'scheme' => $this->t('Scheme.'),
  38. 'valid' => $this->t('Valid.'),
  39. 'weight' => $this->t('Weight.'),
  40. 'is_default' => $this->t('Is default.'),
  41. 'machine_name' => $this->t('Machine name.'),
  42. ];
  43. }
  44. /**
  45. * {@inheritdoc}
  46. */
  47. public function getIds() {
  48. return ['domain_id' => ['type' => 'integer']];
  49. }
  50. }