function hook_config_import_create

Create configuration upon synchronizing configuration changes.

This callback is invoked when configuration is synchronized between storages and allows a module to take over the synchronization of configuration data.

Modules should implement this callback if they manage configuration data (such as image styles, node types, or fields) which needs to be prepared and passed through module API functions to properly handle a configuration change.

Parameters

string $name: The name of the configuration object.

Drupal\Core\Config\Config $new_config: A configuration object containing the new configuration data.

Drupal\Core\Config\Config $old_config: A configuration object containing the old configuration data.

4 functions implement hook_config_import_create()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

config_test_config_import_create in drupal/core/modules/config/tests/config_test/config_test.module
Implements hook_config_import_create().
contact_config_import_create in drupal/core/modules/contact/contact.module
Implements MODULE_config_import_create().
image_config_import_create in drupal/core/modules/image/image.module
Implements hook_config_import_create().
views_config_import_create in drupal/core/modules/views/views.module
Implements hook_config_import_create().

File

drupal/core/modules/config/config.api.php, line 33
Hooks provided by the Configuration module.

Code

function hook_config_import_create($name, $new_config, $old_config) {

  // Only configuration entities require custom handling. Any other module
  // settings can be synchronized directly.
  if (strpos($name, 'config_test.dynamic.') !== 0) {
    return FALSE;
  }
  $config_test = entity_create('config_test', $new_config
    ->get());
  $config_test
    ->save();
  return TRUE;
}