function ConfigFactory::createConfigObject

Same name in other branches
  1. 9 core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::createConfigObject()
  2. 10 core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::createConfigObject()
  3. 11.x core/lib/Drupal/Core/Config/ConfigFactory.php \Drupal\Core\Config\ConfigFactory::createConfigObject()

Creates a configuration object.

Parameters

string $name: Configuration object name.

bool $immutable: Determines whether a mutable or immutable config object is returned.

Return value

\Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig The configuration object.

2 calls to ConfigFactory::createConfigObject()
ConfigFactory::doGet in core/lib/Drupal/Core/Config/ConfigFactory.php
Returns a configuration object for a given name.
ConfigFactory::doLoadMultiple in core/lib/Drupal/Core/Config/ConfigFactory.php
Returns a list of configuration objects for the given names.

File

core/lib/Drupal/Core/Config/ConfigFactory.php, line 409

Class

ConfigFactory
Defines the configuration object factory.

Namespace

Drupal\Core\Config

Code

protected function createConfigObject($name, $immutable) {
    if ($immutable) {
        return new ImmutableConfig($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager);
    }
    return new Config($name, $this->storage, $this->eventDispatcher, $this->typedConfigManager);
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.