Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / web / core / lib / Drupal / Core / Config / ConfigInstallerInterface.php
1 <?php
2
3 namespace Drupal\Core\Config;
4
5 /**
6  * Interface for classes that install config.
7  */
8 interface ConfigInstallerInterface {
9
10   /**
11    * Installs the default configuration of a given extension.
12    *
13    * When an extension is installed, it searches all the default configuration
14    * directories for all other extensions to locate any configuration with its
15    * name prefix. For example, the Node module provides the frontpage view as a
16    * default configuration file:
17    * core/modules/node/config/install/views.view.frontpage.yml
18    * When the Views module is installed after the Node module is already
19    * enabled, the frontpage view will be installed.
20    *
21    * Additionally, the default configuration directory for the extension being
22    * installed is searched to discover if it contains default configuration
23    * that is owned by other enabled extensions. So, the frontpage view will also
24    * be installed when the Node module is installed after Views.
25    *
26    * @param string $type
27    *   The extension type; e.g., 'module' or 'theme'.
28    * @param string $name
29    *   The name of the module or theme to install default configuration for.
30    *
31    * @see \Drupal\Core\Config\ExtensionInstallStorage
32    */
33   public function installDefaultConfig($type, $name);
34
35   /**
36    * Installs optional configuration.
37    *
38    * Optional configuration is only installed if:
39    * - the configuration does not exist already.
40    * - it's a configuration entity.
41    * - its dependencies can be met.
42    *
43    * @param \Drupal\Core\Config\StorageInterface $storage
44    *   (optional) The configuration storage to search for optional
45    *   configuration. If not provided, all enabled extension's optional
46    *   configuration directories including the install profile's will be
47    *   searched.
48    * @param array $dependency
49    *   (optional) If set, ensures that the configuration being installed has
50    *   this dependency. The format is dependency type as the key ('module',
51    *   'theme', or 'config') and the dependency name as the value
52    *   ('book', 'bartik', 'views.view.frontpage').
53    */
54   public function installOptionalConfig(StorageInterface $storage = NULL, $dependency = []);
55
56   /**
57    * Installs all default configuration in the specified collection.
58    *
59    * The function is useful if the site needs to respond to an event that has
60    * just created another collection and we need to check all the installed
61    * extensions for any matching configuration. For example, if a language has
62    * just been created.
63    *
64    * @param string $collection
65    *   The configuration collection.
66    */
67   public function installCollectionDefaultConfig($collection);
68
69   /**
70    * Sets the configuration storage that provides the default configuration.
71    *
72    * @param \Drupal\Core\Config\StorageInterface $storage
73    *
74    * @return $this
75    */
76   public function setSourceStorage(StorageInterface $storage);
77
78   /**
79    * Sets the status of the isSyncing flag.
80    *
81    * @param bool $status
82    *   The status of the sync flag.
83    *
84    * @return $this
85    */
86   public function setSyncing($status);
87
88   /**
89    * Gets the syncing state.
90    *
91    * @return bool
92    *   Returns TRUE is syncing flag set.
93    */
94   public function isSyncing();
95
96   /**
97    * Checks the configuration that will be installed for an extension.
98    *
99    * @param string $type
100    *   Type of extension to install.
101    * @param string $name
102    *   Name of extension to install.
103    *
104    * @throws \Drupal\Core\Config\UnmetDependenciesException
105    * @throws \Drupal\Core\Config\PreExistingConfigException
106    */
107   public function checkConfigurationToInstall($type, $name);
108
109 }