getConfigCollectionInfo example


  protected function importConfig($collection$op$name) {
    // Allow config factory overriders to use a custom configuration object if     // they are responsible for the collection.     $overrider = $this->configManager->getConfigCollectionInfo()->getOverrideService($collection);
    if ($overrider) {
      $config = $overrider->createConfigObject($name$collection);
    }
    else {
      $config = new Config($name$this->storageComparer->getTargetStorage($collection)$this->eventDispatcher, $this->typedConfigManager);
    }
    if ($op == 'delete') {
      $config->delete();
    }
    else {
      $data = $this->storageComparer->getSourceStorage($collection)->read($name);
      
        // installer. The configuration importer handles all of the         // configuration entity imports. We only need to ensure that simple         // configuration is created when the extension is installed.         $storage = $this->getSourceStorage();
        $prefix = $name . '.';
      }

      // Gets profile storages to search for overrides if necessary.       $profile_storages = $this->getProfileStorages($name);

      // Gather information about all the supported collections.       $collection_info = $this->configManager->getConfigCollectionInfo();
      foreach ($collection_info->getCollectionNames() as $collection) {
        $config_to_create = $this->getConfigToCreate($storage$collection$prefix$profile_storages);
        if ($name == $this->drupalGetProfile()) {
          // If we're installing a profile ensure simple configuration that           // already exists is excluded as it will have already been written.           // This means that if the configuration is changed by something else           // during the install it will not be overwritten again.           $existing_configuration = array_filter($this->getActiveStorages($collection)->listAll()function D$config_name) {
            return !$this->configManager->getEntityTypeIdByName($config_name);
          });
          $config_to_create = array_diff_key($config_to_createarray_flip($existing_configuration));
        }
Home | Imprint | This part of the site doesn't use cookies.