3 namespace Drupal\migrate_drupal\Plugin\migrate\source\d8;
5 use Drupal\migrate\Row;
6 use Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase;
9 * Drupal config source from database.
13 * source_module = "system",
16 class Config extends DrupalSqlBase {
21 public function query() {
22 $query = $this->select('config', 'c')
23 ->fields('c', ['collection', 'name', 'data']);
24 if (!empty($this->configuration['collections'])) {
25 $query->condition('collection', (array) $this->configuration['collections'], 'IN');
27 if (!empty($this->configuration['names'])) {
28 $query->condition('name', (array) $this->configuration['names'], 'IN');
36 public function prepareRow(Row $row) {
37 $row->setSourceProperty('data', unserialize($row->getSourceProperty('data')));
43 public function fields() {
45 'collection' => $this->t('The config object collection.'),
46 'name' => $this->t('The config object name.'),
47 'data' => $this->t('Serialized configuration object data.'),
54 public function getIds() {
55 $ids['collection']['type'] = 'string';
56 $ids['name']['type'] = 'string';