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.
15 class Config extends DrupalSqlBase {
20 public function query() {
21 $query = $this->select('config', 'c')
22 ->fields('c', ['collection', 'name', 'data']);
23 if (!empty($this->configuration['collections'])) {
24 $query->condition('collection', (array) $this->configuration['collections'], 'IN');
26 if (!empty($this->configuration['names'])) {
27 $query->condition('name', (array) $this->configuration['names'], 'IN');
35 public function prepareRow(Row $row) {
36 $row->setSourceProperty('data', unserialize($row->getSourceProperty('data')));
42 public function fields() {
44 'collection' => $this->t('The config object collection.'),
45 'name' => $this->t('The config object name.'),
46 'data' => $this->t('Serialized configuration object data.'),
53 public function getIds() {
54 $ids['collection']['type'] = 'string';
55 $ids['name']['type'] = 'string';