protected ConfigFactory::doGet($name, $immutable = TRUE)
Returns a configuration object for a given name.
Parameters
string $name: The name of the configuration object to construct.
bool $immutable: (optional) Create an immutable configuration object. Defaults to TRUE.
Return value
\Drupal\Core\Config\Config|\Drupal\Core\Config\ImmutableConfig A configuration object.
File
- core/lib/Drupal/Core/Config/ConfigFactory.php, line 103
Class
- ConfigFactory
- Defines the configuration object factory.
Namespace
Drupal\Core\Config
Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 | protected function doGet( $name , $immutable = TRUE) { if ( $config = $this ->doLoadMultiple( array ( $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( array ( $name )); if (isset( $overrides [ $name ])) { $config ->setModuleOverride( $overrides [ $name ]); } // Apply any settings.php overrides. if (isset( $GLOBALS [ 'config' ][ $name ])) { $config ->setSettingsOverride( $GLOBALS [ 'config' ][ $name ]); } } foreach ( $this ->configFactoryOverrides as $override ) { $config ->addCacheableDependency( $override ->getCacheableMetadata( $name )); } return $config ; } } |
Please login to continue.