Chris@0: configManager = $config_manager; Chris@0: $this->sourceStorage = $source_storage; Chris@0: $this->snapshotStorage = $snapshot_storage; Chris@0: } Chris@0: Chris@0: /** Chris@0: * Creates a config snapshot. Chris@0: * Chris@0: * @param \Drupal\Core\Config\ConfigImporterEvent $event Chris@0: * The Event to process. Chris@0: */ Chris@0: public function onConfigImporterImport(ConfigImporterEvent $event) { Chris@0: $this->configManager->createSnapshot($this->sourceStorage, $this->snapshotStorage); Chris@0: } Chris@0: Chris@0: /** Chris@0: * Registers the methods in this class that should be listeners. Chris@0: * Chris@0: * @return array Chris@0: * An array of event listener definitions. Chris@0: */ Chris@0: public static function getSubscribedEvents() { Chris@0: $events[ConfigEvents::IMPORT][] = ['onConfigImporterImport', 40]; Chris@0: return $events; Chris@0: } Chris@0: Chris@0: }