Security update for Core, with self-updated composer
[yaffs-website] / web / core / lib / Drupal / Core / Config / TypedConfigManagerInterface.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 use Drupal\Core\TypedData\TypedDataManagerInterface;
6
7 /**
8  * Defines an interface for managing config schema type plugins.
9  *
10  * @see \Drupal\Core\Config\TypedConfigManager
11  * @see \Drupal\Core\Config\Schema\ConfigSchemaDiscovery
12  * @see hook_config_schema_info_alter()
13  * @see https://www.drupal.org/node/1905070
14  */
15 interface TypedConfigManagerInterface extends TypedDataManagerInterface {
16
17   /**
18    * Gets typed configuration data.
19    *
20    * @param string $name
21    *   Configuration object name.
22    *
23    * @return \Drupal\Core\TypedData\TraversableTypedDataInterface
24    *   Typed configuration element.
25    */
26   public function get($name);
27
28   /**
29    * Creates a new data definition object from a type definition array and
30    * actual configuration data. Since type definitions may contain variables
31    * to be replaced, we need the configuration value to create it.
32    *
33    * @param array $definition
34    *   The base type definition array, for which a data definition should be
35    *   created.
36    * @param $value
37    *   Optional value of the configuration element.
38    * @param string $name
39    *   Optional name of the configuration element.
40    * @param object $parent
41    *   Optional parent element.
42    *
43    * @return \Drupal\Core\TypedData\DataDefinitionInterface
44    *   A data definition for the given data type.
45    */
46   public function buildDataDefinition(array $definition, $value, $name = NULL, $parent = NULL);
47
48   /**
49    * Checks if the configuration schema with the given config name exists.
50    *
51    * @param string $name
52    *   Configuration name.
53    *
54    * @return bool
55    *   TRUE if configuration schema exists, FALSE otherwise.
56    */
57   public function hasConfigSchema($name);
58
59   /**
60    * Gets a specific plugin definition.
61    *
62    * @param string $plugin_id
63    *   A plugin id.
64    * @param bool $exception_on_invalid
65    *   Ignored with TypedConfigManagerInterface. Kept for compatibility with
66    *   DiscoveryInterface.
67    *
68    * @return array
69    *   A plugin definition array. If the given plugin id does not have typed
70    *   configuration definition assigned, the definition of an undefined
71    *   element type is returned.
72    */
73   public function getDefinition($plugin_id, $exception_on_invalid = TRUE);
74
75   /**
76    * Gets typed data for a given configuration name and its values.
77    *
78    * @param string $config_name
79    *   The machine name of the configuration.
80    * @param array $config_data
81    *   The data associated with the configuration. Note: This configuration
82    *   doesn't yet have to be stored.
83    *
84    * @return \Drupal\Core\TypedData\TraversableTypedDataInterface
85    *   The typed configuration element.
86    */
87   public function createFromNameAndData($config_name, array $config_data);
88
89 }