class Config
Same name in this branch
- 9 composer/Plugin/VendorHardening/Config.php \Drupal\Composer\Plugin\VendorHardening\Config
- 9 core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config
- 9 core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config
Same name and namespace in other branches
- 10 composer/Plugin/VendorHardening/Config.php \Drupal\Composer\Plugin\VendorHardening\Config
- 10 core/modules/migrate_drupal/src/Plugin/migrate/source/d8/Config.php \Drupal\migrate_drupal\Plugin\migrate\source\d8\Config
- 11.x composer/Plugin/VendorHardening/Config.php \Drupal\Composer\Plugin\VendorHardening\Config
- 11.x core/modules/migrate_drupal/src/Plugin/migrate/source/d8/Config.php \Drupal\migrate_drupal\Plugin\migrate\source\d8\Config
- 11.x core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config
- 11.x core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config
- 10 core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config
- 10 core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config
- 8.9.x composer/Plugin/VendorHardening/Config.php \Drupal\Composer\Plugin\VendorHardening\Config
- 8.9.x core/modules/migrate_drupal/src/Plugin/migrate/source/d8/Config.php \Drupal\migrate_drupal\Plugin\migrate\source\d8\Config
- 8.9.x core/modules/migrate/src/Plugin/migrate/destination/Config.php \Drupal\migrate\Plugin\migrate\destination\Config
- 8.9.x core/lib/Drupal/Core/Config/Config.php \Drupal\Core\Config\Config
Drupal 8+ configuration source from database.
Available configuration keys:
- collections: (optional) The collection of configuration storage to retrieve from the source - can be a string or an array. If omitted, configuration objects of all available collections are retrieved.
- names: (optional) Names of configuration objects to retrieve from the source - can be a string or an array. If omitted, all available configuration objects are retrieved.
Examples:
source:
plugin: d8_config
names:
- node.type.article
- node.type.page
In this example configuration objects of article and page content types are retrieved from the source database.
source:
plugin: d8_config
collections: language.fr
names:
- node.type.article
- node.type.page
In this example configuration objects are filtered by language.fr collection. As a result, French versions of specified configuration objects are retrieved from the source database.
For additional configuration keys, refer to the parent classes.
Plugin annotation
@MigrateSource(
id = "d8_config",
source_module = "system",
)
Hierarchy
- class \Drupal\Component\Plugin\PluginBase implements \Drupal\Component\Plugin\PluginInspectionInterface, \Drupal\Component\Plugin\DerivativeInspectionInterface
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\d8\Config extends \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase
- class \Drupal\migrate_drupal\Plugin\migrate\source\DrupalSqlBase implements \Drupal\Component\Plugin\DependentPluginInterface uses \Drupal\Core\Entity\DependencyTrait extends \Drupal\migrate\Plugin\migrate\source\SqlBase
- class \Drupal\migrate\Plugin\migrate\source\SqlBase implements \Drupal\Core\Plugin\ContainerFactoryPluginInterface, \Drupal\migrate\Plugin\RequirementsInterface extends \Drupal\migrate\Plugin\migrate\source\SourcePluginBase
- class \Drupal\migrate\Plugin\migrate\source\SourcePluginBase implements \Drupal\migrate\Plugin\MigrateSourceInterface, \Drupal\migrate\Event\RollbackAwareInterface extends \Drupal\Core\Plugin\PluginBase
- class \Drupal\Core\Plugin\PluginBase uses \Drupal\Core\StringTranslation\StringTranslationTrait, \Drupal\Core\DependencyInjection\DependencySerializationTrait, \Drupal\Core\Messenger\MessengerTrait extends \Drupal\Component\Plugin\PluginBase
Expanded class hierarchy of Config
See also
\Drupal\migrate\Plugin\migrate\source\SqlBase
\Drupal\migrate\Plugin\migrate\source\SourcePluginBase
133 string references to 'Config'
- action_settings.yml in core/
modules/ system/ migrations/ action_settings.yml - core/modules/system/migrations/action_settings.yml
- book_settings.yml in core/
modules/ book/ migrations/ book_settings.yml - core/modules/book/migrations/book_settings.yml
- BootstrapConfigStorageFactory::getDatabaseStorage in core/
lib/ Drupal/ Core/ Config/ BootstrapConfigStorageFactory.php - Returns a Database configuration storage implementation.
- CachedStorageTest::setUp in core/
tests/ Drupal/ KernelTests/ Core/ Config/ Storage/ CachedStorageTest.php - ChangeUserRoleBase::calculateDependencies in core/
modules/ user/ src/ Plugin/ Action/ ChangeUserRoleBase.php
File
-
core/
modules/ migrate_drupal/ src/ Plugin/ migrate/ source/ d8/ Config.php, line 55
Namespace
Drupal\migrate_drupal\Plugin\migrate\source\d8View source
class Config extends DrupalSqlBase {
/**
* {@inheritdoc}
*/
public function query() {
$query = $this->select('config', 'c')
->fields('c', [
'collection',
'name',
'data',
]);
if (!empty($this->configuration['collections'])) {
$query->condition('collection', (array) $this->configuration['collections'], 'IN');
}
if (!empty($this->configuration['names'])) {
$query->condition('name', (array) $this->configuration['names'], 'IN');
}
return $query;
}
/**
* {@inheritdoc}
*/
public function prepareRow(Row $row) {
$row->setSourceProperty('data', unserialize($row->getSourceProperty('data')));
return parent::prepareRow($row);
}
/**
* {@inheritdoc}
*/
public function fields() {
return [
'collection' => $this->t('The config object collection.'),
'name' => $this->t('The config object name.'),
'data' => $this->t('Serialized configuration object data.'),
];
}
/**
* {@inheritdoc}
*/
public function getIds() {
$ids['collection']['type'] = 'string';
$ids['name']['type'] = 'string';
return $ids;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.