Version 1
[yaffs-website] / web / core / modules / config / tests / config_schema_test / config_schema_test.module
1 <?php
2
3 /**
4  * @file
5  * Tests configuration schema functionality.
6  */
7
8 /**
9  * Implements hook_config_schema_info_alter().
10  */
11 function config_schema_test_config_schema_info_alter(&$definitions) {
12   if (\Drupal::state()->get('config_schema_test_exception_add')) {
13     $definitions['config_schema_test.hook_added_defintion'] = $definitions['config_schema_test.hook'];
14   }
15   if (\Drupal::state()->get('config_schema_test_exception_remove')) {
16     unset($definitions['config_schema_test.hook']);
17   }
18
19   // Since code can not be unloaded only alter the definition if it exists.
20   if (isset($definitions['config_schema_test.hook'])) {
21     $definitions['config_schema_test.hook']['additional_metadata'] = 'new schema info';
22   }
23 }