Skip to content

Commit

Permalink
Merge pull request #1 from langelhc/8.x-1.x
Browse files Browse the repository at this point in the history
Add D7 Migrate Source Plugin for Domain Records
  • Loading branch information
enzolutions authored Jul 10, 2017
2 parents b4a3814 + dfc9d8d commit 949d52c
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions domain/src/Plugin/migrate/source/d7/DomainRecord.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
<?php

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

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

/**
* Drupal 7 Domain source from database.
*
* @MigrateSource(
* id = "d7_domain"
* )
*/
class DomainRecord extends DrupalSqlBase {

/**
* {@inheritdoc}
*/
public function query() {
$fields = [
'domain_id',
'subdomain',
'sitename',
'scheme',
'valid',
'weight',
'is_default',
'machine_name',
];
return $this->select('domain', 'd')->fields('d', $fields);
}

/**
* {@inheritdoc}
*/
public function fields() {
return [
'domain_id' => $this->t('Domain ID.'),
'subdomain' => $this->t('Subdomain.'),
'sitename' => $this->t('Sitename.'),
'scheme' => $this->t('Scheme.'),
'valid' => $this->t('Valid.'),
'weight' => $this->t('Weight.'),
'is_default' => $this->t('Is default.'),
'machine_name' => $this->t('Machine name.'),
];
}

/**
* {@inheritdoc}
*/
public function getIds() {
return ['domain_id' => ['type' => 'int']];
}

}

0 comments on commit 949d52c

Please sign in to comment.