interface ConfigFactoryInterface

Same name in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/ConfigFactoryInterface.php \Drupal\Core\Config\ConfigFactoryInterface
  2. 10 core/lib/Drupal/Core/Config/ConfigFactoryInterface.php \Drupal\Core\Config\ConfigFactoryInterface
  3. 11.x core/lib/Drupal/Core/Config/ConfigFactoryInterface.php \Drupal\Core\Config\ConfigFactoryInterface

Defines the interface for a configuration object factory.

Hierarchy

Expanded class hierarchy of ConfigFactoryInterface

All classes that implement ConfigFactoryInterface

Related topics

145 files declare their use of ConfigFactoryInterface
AccountSettingsForm.php in core/modules/user/src/AccountSettingsForm.php
AdminNegotiator.php in core/modules/user/src/Theme/AdminNegotiator.php
AdminPathConfigEntityConverter.php in core/lib/Drupal/Core/ParamConverter/AdminPathConfigEntityConverter.php
AjaxBasePageNegotiator.php in core/lib/Drupal/Core/Theme/AjaxBasePageNegotiator.php
AjaxResponseAttachmentsProcessor.php in core/lib/Drupal/Core/Ajax/AjaxResponseAttachmentsProcessor.php

... See full list

File

core/lib/Drupal/Core/Config/ConfigFactoryInterface.php, line 10

Namespace

Drupal\Core\Config
View source
interface ConfigFactoryInterface {
    
    /**
     * Returns an immutable configuration object for a given name.
     *
     * @param string $name
     *   The name of the configuration object to construct.
     *
     * @return \Drupal\Core\Config\ImmutableConfig
     *   A configuration object.
     */
    public function get($name);
    
    /**
     * Returns a 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.
     *
     * @param string $name
     *   The name of the configuration object to construct.
     *
     * @return \Drupal\Core\Config\Config
     *   A configuration object.
     */
    public function getEditable($name);
    
    /**
     * 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.
     *
     * @param array $names
     *   List of names of configuration objects.
     *
     * @return \Drupal\Core\Config\ImmutableConfig[]
     *   List of successfully loaded configuration objects, keyed by name.
     */
    public function loadMultiple(array $names);
    
    /**
     * Resets and re-initializes configuration objects. Internal use only.
     *
     * @param string|null $name
     *   (optional) The name of the configuration object to reset. If omitted, all
     *   configuration objects are reset.
     *
     * @return $this
     */
    public function reset($name = NULL);
    
    /**
     * Renames a configuration object using the storage.
     *
     * @param string $old_name
     *   The old name of the configuration object.
     * @param string $new_name
     *   The new name of the configuration object.
     *
     * @return $this
     */
    public function rename($old_name, $new_name);
    
    /**
     * 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.
     *
     * @return array
     *   An array of strings, used to generate a cache ID.
     */
    public function getCacheKeys();
    
    /**
     * Clears the config factory static cache.
     *
     * @return $this
     */
    public function clearStaticCache();
    
    /**
     * Gets configuration object names starting with a given prefix.
     *
     * @see \Drupal\Core\Config\StorageInterface::listAll()
     *
     * @param string $prefix
     *   (optional) The prefix to search for. If omitted, all configuration object
     *   names that exist are returned.
     *
     * @return array
     *   An array containing matching configuration object names.
     */
    public function listAll($prefix = '');
    
    /**
     * Adds config factory override services.
     *
     * @param \Drupal\Core\Config\ConfigFactoryOverrideInterface $config_factory_override
     *   The config factory override service to add. It is added at the end of the
     *   priority list (lower priority relative to existing ones).
     */
    public function addOverride(ConfigFactoryOverrideInterface $config_factory_override);

}

Members

Title Sort descending Modifiers Object type Summary Overrides
ConfigFactoryInterface::addOverride public function Adds config factory override services. 1
ConfigFactoryInterface::clearStaticCache public function Clears the config factory static cache. 1
ConfigFactoryInterface::get public function Returns an immutable configuration object for a given name. 1
ConfigFactoryInterface::getCacheKeys public function The cache keys associated with the state of the config factory. 1
ConfigFactoryInterface::getEditable public function Returns a mutable configuration object for a given name. 1
ConfigFactoryInterface::listAll public function Gets configuration object names starting with a given prefix. 1
ConfigFactoryInterface::loadMultiple public function Returns a list of configuration objects for the given names. 1
ConfigFactoryInterface::rename public function Renames a configuration object using the storage. 1
ConfigFactoryInterface::reset public function Resets and re-initializes configuration objects. Internal use only. 1

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