3 namespace Drupal\Core\Config;
5 use Drupal\Core\TypedData\TypedDataManagerInterface;
8 * Defines an interface for managing config schema type plugins.
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
15 interface TypedConfigManagerInterface extends TypedDataManagerInterface {
18 * Gets typed configuration data.
21 * Configuration object name.
23 * @return \Drupal\Core\TypedData\TraversableTypedDataInterface
24 * Typed configuration element.
26 public function get($name);
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.
33 * @param array $definition
34 * The base type definition array, for which a data definition should be
37 * Optional value of the configuration element.
39 * Optional name of the configuration element.
40 * @param object $parent
41 * Optional parent element.
43 * @return \Drupal\Core\TypedData\DataDefinitionInterface
44 * A data definition for the given data type.
46 public function buildDataDefinition(array $definition, $value, $name = NULL, $parent = NULL);
49 * Checks if the configuration schema with the given config name exists.
55 * TRUE if configuration schema exists, FALSE otherwise.
57 public function hasConfigSchema($name);
60 * Gets a specific plugin definition.
62 * @param string $plugin_id
64 * @param bool $exception_on_invalid
65 * Ignored with TypedConfigManagerInterface. Kept for compatibility with
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.
73 public function getDefinition($plugin_id, $exception_on_invalid = TRUE);
76 * Gets typed data for a given configuration name and its values.
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.
84 * @return \Drupal\Core\TypedData\TraversableTypedDataInterface
85 * The typed configuration element.
87 public function createFromNameAndData($config_name, array $config_data);