function TypedConfigManager::createFromNameAndData

Same name and namespace in other branches
  1. 8.9.x core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::createFromNameAndData()
  2. 10 core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::createFromNameAndData()
  3. 11.x core/lib/Drupal/Core/Config/TypedConfigManager.php \Drupal\Core\Config\TypedConfigManager::createFromNameAndData()

Gets typed data for a given configuration name and its values.

Parameters

string $config_name: The machine name of the configuration.

array $config_data: The data associated with the configuration. Note: This configuration doesn't yet have to be stored.

Return value

\Drupal\Core\TypedData\TraversableTypedDataInterface The typed configuration element.

Overrides TypedConfigManagerInterface::createFromNameAndData

1 call to TypedConfigManager::createFromNameAndData()
TypedConfigManager::get in core/lib/Drupal/Core/Config/TypedConfigManager.php
Gets typed configuration data.

File

core/lib/Drupal/Core/Config/TypedConfigManager.php, line 400

Class

TypedConfigManager
Manages config schema type plugins.

Namespace

Drupal\Core\Config

Code

public function createFromNameAndData($config_name, array $config_data) {
    $definition = $this->getDefinition($config_name);
    $data_definition = $this->buildDataDefinition($definition, $config_data);
    return $this->create($data_definition, $config_data);
}

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