Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Config / ConfigFactoryInterface.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 /**
6  * Defines the interface for a configuration object factory.
7  *
8  * @ingroup config_api
9  */
10 interface ConfigFactoryInterface {
11
12   /**
13    * Returns an immutable configuration object for a given name.
14    *
15    * @param string $name
16    *   The name of the configuration object to construct.
17    *
18    * @return \Drupal\Core\Config\ImmutableConfig
19    *   A configuration object.
20    */
21   public function get($name);
22
23   /**
24    * Returns an mutable configuration object for a given name.
25    *
26    * Should not be used for config that will have runtime effects. Therefore it
27    * is always loaded override free.
28    *
29    * @param string $name
30    *   The name of the configuration object to construct.
31    *
32    * @return \Drupal\Core\Config\Config
33    *   A configuration object.
34    */
35   public function getEditable($name);
36
37   /**
38    * Returns a list of configuration objects for the given names.
39    *
40    * This will pre-load all requested configuration objects does not create
41    * new configuration objects. This method always return immutable objects.
42    * ConfigFactoryInterface::getEditable() should be used to retrieve mutable
43    * configuration objects, one by one.
44    *
45    * @param array $names
46    *   List of names of configuration objects.
47    *
48    * @return \Drupal\Core\Config\ImmutableConfig[]
49    *   List of successfully loaded configuration objects, keyed by name.
50    */
51   public function loadMultiple(array $names);
52
53   /**
54    * Resets and re-initializes configuration objects. Internal use only.
55    *
56    * @param string|null $name
57    *   (optional) The name of the configuration object to reset. If omitted, all
58    *   configuration objects are reset.
59    *
60    * @return $this
61    */
62   public function reset($name = NULL);
63
64   /**
65    * Renames a configuration object using the storage.
66    *
67    * @param string $old_name
68    *   The old name of the configuration object.
69    * @param string $new_name
70    *   The new name of the configuration object.
71    *
72    * @return $this
73    */
74   public function rename($old_name, $new_name);
75
76   /**
77    * The cache keys associated with the state of the config factory.
78    *
79    * All state information that can influence the result of a get() should be
80    * included. Typically, this includes a key for each override added via
81    * addOverride(). This allows external code to maintain caches of
82    * configuration data in addition to or instead of caches maintained by the
83    * factory.
84    *
85    * @return array
86    *   An array of strings, used to generate a cache ID.
87    */
88   public function getCacheKeys();
89
90   /**
91    * Clears the config factory static cache.
92    *
93    * @return $this
94    */
95   public function clearStaticCache();
96
97   /**
98    * Gets configuration object names starting with a given prefix.
99    *
100    * @see \Drupal\Core\Config\StorageInterface::listAll()
101    *
102    * @param string $prefix
103    *   (optional) The prefix to search for. If omitted, all configuration object
104    *   names that exist are returned.
105    *
106    * @return array
107    *   An array containing matching configuration object names.
108    */
109   public function listAll($prefix = '');
110
111   /**
112    * Adds config factory override services.
113    *
114    * @param \Drupal\Core\Config\ConfigFactoryOverrideInterface $config_factory_override
115    *   The config factory override service to add. It is added at the end of the
116    *   priority list (lower priority relative to existing ones).
117    */
118   public function addOverride(ConfigFactoryOverrideInterface $config_factory_override);
119
120 }