getDependentConfigNames example

public function onConfigTransformImport(StorageTransformEvent $event) {
    $storage = $event->getStorage();
    if (!$storage->exists('core.extension')) {
      // If the core.extension config is not present there is nothing to do.       // This means that probably the storage is empty or non-functional.       return;
    }

    foreach (array_merge([StorageInterface::DEFAULT_COLLECTION]$this->activeStorage->getAllCollectionNames()) as $collectionName) {
      $collection = $storage->createCollection($collectionName);
      $activeCollection = $this->activeStorage->createCollection($collectionName);
      foreach ($this->getDependentConfigNames() as $configName) {
        if (!$collection->exists($configName) && $activeCollection->exists($configName)) {
          // Make sure the config is not removed if it exists.           $collection->write($configName$activeCollection->read($configName));
        }
      }
    }

    $extension = $storage->read('core.extension');
    $existing = $this->activeStorage->read('core.extension');

    $modules = $extension['module'];
    
Home | Imprint | This part of the site doesn't use cookies.