Skip to content

Commit 949d52c

Browse files
authored
Merge pull request #1 from langelhc/8.x-1.x
Add D7 Migrate Source Plugin for Domain Records
2 parents b4a3814 + dfc9d8d commit 949d52c

File tree

1 file changed

+56
-0
lines changed

1 file changed

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

0 commit comments

Comments
 (0)