Config import subscriber for config import events.
Expanded class hierarchy of ConfigImportSubscriber
class ConfigImportSubscriber implements EventSubscriberInterface {
/**
* Validates the configuration to be imported.
*
* @param \Drupal\Core\Config\ConfigImporterEvent $event
* The Event to process.
*
* @throws \Drupal\Core\Config\ConfigNameException
*/
public function onConfigImporterValidate(ConfigImporterEvent $event) {
foreach (array(
'delete',
'create',
'update',
) as $op) {
foreach ($event
->getConfigImporter()
->getUnprocessed($op) as $name) {
Config::validateName($name);
}
}
}
/**
* Registers the methods in this class that should be listeners.
*
* @return array
* An array of event listener definitions.
*/
static function getSubscribedEvents() {
$events['config.importer.validate'][] = array(
'onConfigImporterValidate',
40,
);
$events['config.installer.validate'][] = array(
'onConfigImporterValidate',
40,
);
return $events;
}
}
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ConfigImportSubscriber:: |
static | function |
Registers the methods in this class that should be listeners. Overrides EventSubscriberInterface:: |
|
ConfigImportSubscriber:: |
public | function | Validates the configuration to be imported. |