createConfigObject 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);
      $config->setData($data ? $data : []);
      $config->save();
    }
->sortAll();
    }
    else {
      $config_names = array_keys($config_to_create);
    }

    foreach ($config_names as $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) {
        $new_config = $overrider->createConfigObject($name$collection);
      }
      else {
        $new_config = new Config($name$this->getActiveStorages($collection)$this->eventDispatcher, $this->typedConfig);
      }
      if ($config_to_create[$name] !== FALSE) {
        // Add a hash to configuration created through the installer so it is         // possible to know if the configuration was created by installing an         // extension and to track which version of the default config was used.         if (!$this->isSyncing() && $collection == StorageInterface::DEFAULT_COLLECTION) {
          $config_to_create[$name] = [
            '_core' => [
              

  protected function doGet($name$immutable = TRUE) {
    if ($config = $this->doLoadMultiple([$name]$immutable)) {
      return $config[$name];
    }
    else {
      // If the configuration object does not exist in the configuration       // storage, create a new object.       $config = $this->createConfigObject($name$immutable);

      if ($immutable) {
        // Get and apply any overrides.         $overrides = $this->loadOverrides([$name]);
        if (isset($overrides[$name])) {
          $config->setModuleOverride($overrides[$name]);
        }
        // Apply any settings.php overrides.         if (isset($GLOBALS['config'][$name])) {
          $config->setSettingsOverride($GLOBALS['config'][$name]);
        }
      }
Home | Imprint | This part of the site doesn't use cookies.