/
ConfigUpdaterInterface.php
102 lines (93 loc) · 3.12 KB
/
ConfigUpdaterInterface.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<?php
namespace Drupal\commerce;
/**
* Performs configuration updates on behalf of an extension.
*
* Service to provide methods for extensions to import, revert, or delete
* configuration once they have been installed. Intended to be run from
* hook_post_update_NAME(), since this involves the modification of entities.
*
* @see hook_post_update_NAME()
*/
interface ConfigUpdaterInterface {
/**
* Imports configuration from extension storage to active storage.
*
* This action triggers a ConfigRevertInterface::IMPORT event if the
* configuration could be imported.
*
* @param string[] $config_names
* An array of configuration names.
*
* @return \Drupal\commerce\ConfigUpdaterResultInterface
* Object containing failed and succeeded configuration object update.
* May also throw exceptions if there is a problem during saving the
* configuration.
*/
public function import(array $config_names);
/**
* Reverts configuration to the value from extension storage.
*
* This action triggers a ConfigRevertInterface::REVERT event.
*
* @param string[] $config_names
* An array of configuration names.
* @param bool $skip_modified
* Whether to skip modified configuration, defaults to TRUE. If this is
* set to false, it will revert active configuration that has been
* modified to the configuration values in the extension.
*
* @return \Drupal\commerce\ConfigUpdaterResultInterface
* Object containing failed and succeeded configuration object update.
* May also throw exceptions if there is a problem during saving the
* configuration.
*/
public function revert(array $config_names, $skip_modified = TRUE);
/**
* Deletes a configuration item.
*
* This action triggers a ConfigDeleteInterface::DELETE event.
*
* @param string[] $config_names
* An array of configuration names.
*
* @return \Drupal\commerce\ConfigUpdaterResultInterface
* Object containing failed and succeeded configuration object update.
* May also throw exceptions if there is a problem during saving the
* configuration.
*/
public function delete(array $config_names);
/**
* Gets the current active value of configuration.
*
* @param string $config_name
* The configuration item's full name.
*
* @return array
* The configuration value.
*/
public function loadFromActive($config_name);
/**
* Gets the extension storage value of configuration.
*
* This is the value from a file in the config/install or config/optional
* directory of a module, theme, or install profile.
*
* @param string $config_name
* The configuration item's full name.
*
* @return array|false
* The configuration value, or FALSE if it could not be located.
*/
public function loadFromExtension($config_name);
/**
* Compares a config item's has been modified since its installation.
*
* @param string $config_name
* The configuration item's full name.
*
* @return bool
* Returns TRUE is modified, FALSE if original configuration.
*/
public function isModified($config_name);
}