Drupal 8  8.0.2
ConfigFactory Class Reference
Inheritance diagram for ConfigFactory:

Public Member Functions

 __construct (StorageInterface $storage, EventDispatcherInterface $event_dispatcher, TypedConfigManagerInterface $typed_config)
 
 getEditable ($name)
 
 get ($name)
 
 loadMultiple (array $names)
 
 reset ($name=NULL)
 
 rename ($old_name, $new_name)
 
 getCacheKeys ()
 
 clearStaticCache ()
 
 listAll ($prefix= '')
 
 onConfigSave (ConfigCrudEvent $event)
 
 onConfigDelete (ConfigCrudEvent $event)
 
 addOverride (ConfigFactoryOverrideInterface $config_factory_override)
 

Static Public Member Functions

static getSubscribedEvents ()
 

Protected Member Functions

 doGet ($name, $immutable=TRUE)
 
 doLoadMultiple (array $names, $immutable=TRUE)
 
 loadOverrides (array $names)
 
 propagateConfigOverrideCacheability ($cache_key, $name)
 
 getConfigCacheKey ($name, $immutable)
 
 getConfigCacheKeys ($name)
 
 createConfigObject ($name, $immutable)
 

Protected Attributes

 $storage
 
 $eventDispatcher
 
 $cache = array()
 
 $typedConfigManager
 
 $configFactoryOverrides = array()
 

Detailed Description

Defines the configuration object factory.

The configuration object factory instantiates a Config object for each configuration object name that is accessed and returns it to callers.

See Also

Each configuration object gets a storage object injected, which is used for reading and writing the configuration data.

See Also

Constructor & Destructor Documentation

__construct ( StorageInterface  $storage,
EventDispatcherInterface  $event_dispatcher,
TypedConfigManagerInterface  $typed_config 
)

Constructs the Config factory.

Parameters
\Drupal\Core\Config\StorageInterface$storageThe configuration storage engine.
\Symfony\Component\EventDispatcher\EventDispatcherInterface$event_dispatcherAn event dispatcher instance to use for configuration events.
\Drupal\Core\Config\TypedConfigManagerInterface$typed_configThe typed configuration manager.

Member Function Documentation

addOverride ( ConfigFactoryOverrideInterface  $config_factory_override)

{Adds config factory override services.

Parameters
\Drupal\Core\Config\ConfigFactoryOverrideInterface$config_factory_overrideThe config factory override service to add. It is added at the end of the priority list (lower priority relative to existing ones).
}

Implements ConfigFactoryInterface.

clearStaticCache ( )

{Clears the config factory static cache.

Returns
$this
}

Implements ConfigFactoryInterface.

References Drupal\cache().

Here is the call graph for this function:

createConfigObject (   $name,
  $immutable 
)
protected

Creates a configuration object.

Parameters
string$nameConfiguration object name.
bool$immutableDetermines whether a mutable or immutable config object is returned.
Returns
| The configuration object.

Referenced by ConfigFactory\doGet(), and ConfigFactory\doLoadMultiple().

Here is the caller graph for this function:

doGet (   $name,
  $immutable = TRUE 
)
protected

Returns a configuration object for a given name.

Parameters
string$nameThe name of the configuration object to construct.
bool$immutable(optional) Create an immutable configuration object. Defaults to TRUE.
Returns
| A configuration object.

References ConfigFactory\createConfigObject(), ConfigFactory\doLoadMultiple(), and ConfigFactory\loadOverrides().

Referenced by ConfigFactory\get(), and ConfigFactory\getEditable().

Here is the call graph for this function:

Here is the caller graph for this function:

doLoadMultiple ( array  $names,
  $immutable = TRUE 
)
protected

Returns a list of configuration objects for the given names.

Parameters
array$namesList of names of configuration objects.
bool$immutable(optional) Create an immutable configuration objects. Defaults to TRUE.
Returns
[]|[] List of successfully loaded configuration objects, keyed by name.

References Drupal\cache(), ConfigFactory\createConfigObject(), ConfigFactory\getConfigCacheKey(), ConfigFactory\loadOverrides(), and ConfigFactory\propagateConfigOverrideCacheability().

Referenced by ConfigFactory\doGet(), and ConfigFactory\loadMultiple().

Here is the call graph for this function:

Here is the caller graph for this function:

get (   $name)

{Returns an immutable configuration object for a given name.

Parameters
string$nameThe name of the configuration object to construct.
Returns
A configuration object.
}

Implements ConfigFactoryInterface.

References ConfigFactory\doGet().

Here is the call graph for this function:

getCacheKeys ( )

{The cache keys associated with the state of the config factory.All state information that can influence the result of a get() should be included. Typically, this includes a key for each override added via addOverride(). This allows external code to maintain caches of configuration data in addition to or instead of caches maintained by the factory.

Returns
array An array of strings, used to generate a cache ID.
}

Implements ConfigFactoryInterface.

Referenced by ConfigFactory\getConfigCacheKey().

Here is the caller graph for this function:

getConfigCacheKey (   $name,
  $immutable 
)
protected

Gets the static cache key for a given config name.

Parameters
string$nameThe name of the configuration object.
bool$immutableWhether or not the object is mutable.
Returns
string The cache key.

References ConfigFactory\getCacheKeys().

Referenced by ConfigFactory\doLoadMultiple().

Here is the call graph for this function:

Here is the caller graph for this function:

getConfigCacheKeys (   $name)
protected

Gets all the cache keys that match the provided config name.

Parameters
string$nameThe name of the configuration object.
Returns
array An array of cache keys that match the provided config name.

References Drupal\cache().

Referenced by ConfigFactory\onConfigDelete(), ConfigFactory\onConfigSave(), ConfigFactory\rename(), and ConfigFactory\reset().

Here is the call graph for this function:

Here is the caller graph for this function:

getEditable (   $name)

{Returns an mutable configuration object for a given name.Should not be used for config that will have runtime effects. Therefore it is always loaded override free.

Parameters
string$nameThe name of the configuration object to construct.
Returns
A configuration object.
}

Implements ConfigFactoryInterface.

References ConfigFactory\doGet().

Here is the call graph for this function:

static getSubscribedEvents ( )
static

{}

listAll (   $prefix = '')

{Gets configuration object names starting with a given prefix.

See Also
::listAll()
Parameters
string$prefix(optional) The prefix to search for. If omitted, all configuration object names that exist are returned.
Returns
array An array containing matching configuration object names.
}

Implements ConfigFactoryInterface.

loadMultiple ( array  $names)

{Returns a list of configuration objects for the given names.This will pre-load all requested configuration objects does not create new configuration objects. This method always return immutable objects. ConfigFactoryInterface::getEditable() should be used to retrieve mutable configuration objects, one by one.

Parameters
array$namesList of names of configuration objects.
Returns
[] List of successfully loaded configuration objects, keyed by name.
}

Implements ConfigFactoryInterface.

References ConfigFactory\doLoadMultiple().

Here is the call graph for this function:

loadOverrides ( array  $names)
protected

Get arbitrary overrides for the named configuration objects from modules.

Parameters
array$namesThe names of the configuration objects to get overrides for.
Returns
array An array of overrides keyed by the configuration object name.

References NestedArray\mergeDeepArray().

Referenced by ConfigFactory\doGet(), and ConfigFactory\doLoadMultiple().

Here is the call graph for this function:

Here is the caller graph for this function:

onConfigDelete ( ConfigCrudEvent  $event)

Removes stale static cache entries when configuration is deleted.

Parameters
\Drupal\Core\Config\ConfigCrudEvent$eventThe configuration event.

References Drupal\cache(), ConfigCrudEvent\getConfig(), and ConfigFactory\getConfigCacheKeys().

Here is the call graph for this function:

onConfigSave ( ConfigCrudEvent  $event)

Updates stale static cache entries when configuration is saved.

Parameters
ConfigCrudEvent$eventThe configuration event.

References Drupal\cache(), ConfigCrudEvent\getConfig(), and ConfigFactory\getConfigCacheKeys().

Here is the call graph for this function:

propagateConfigOverrideCacheability (   $cache_key,
  $name 
)
protected

Propagates cacheability of config overrides to cached config objects.

Parameters
string$cache_keyThe key of the cached config object to update.
string$nameThe name of the configuration object to construct.

References Drupal\cache().

Referenced by ConfigFactory\doLoadMultiple().

Here is the call graph for this function:

Here is the caller graph for this function:

rename (   $old_name,
  $new_name 
)

{Renames a configuration object using the storage.

Parameters
string$old_nameThe old name of the configuration object.
string$new_nameThe new name of the configuration object.
Returns
$this
}

Implements ConfigFactoryInterface.

References Drupal\cache(), ConfigFactory\getConfigCacheKeys(), and Cache\invalidateTags().

Here is the call graph for this function:

reset (   $name = NULL)

{Resets and re-initializes configuration objects. Internal use only.

Parameters
string | null$name(optional) The name of the configuration object to reset. If omitted, all configuration objects are reset.
Returns
$this
}

Implements ConfigFactoryInterface.

References Drupal\cache(), and ConfigFactory\getConfigCacheKeys().

Here is the call graph for this function:


The documentation for this class was generated from the following file: