You are here

interface ConfigUpdaterInterface in Commerce Core 8.2

Performs configuration updates.

Allows an extension to import, revert, delete configuration. Needs to be used from hook_post_update_NAME(), since it uses the entity API.

Hierarchy

Expanded class hierarchy of ConfigUpdaterInterface

All classes that implement ConfigUpdaterInterface

See also

hook_post_update_NAME()

File

src/Config/ConfigUpdaterInterface.php, line 13

Namespace

Drupal\commerce\Config
View source
interface ConfigUpdaterInterface {

  /**
   * Imports configuration from extension storage to active storage.
   *
   * @param string[] $config_names
   *   The configuration names.
   *
   * @return \Drupal\commerce\Config\ConfigUpdateResult
   *   The result.
   */
  public function import(array $config_names);

  /**
   * Reverts configuration to the values from extension storage.
   *
   * @param string[] $config_names
   *   The configuration names.
   * @param bool $skip_modified
   *   Whether to skip modified configuration.
   *
   * @return \Drupal\commerce\Config\ConfigUpdateResult
   *   The result.
   */
  public function revert(array $config_names, $skip_modified = TRUE);

  /**
   * Deletes configuration.
   *
   * @param string[] $config_names
   *   The configuration names.
   *
   * @return \Drupal\commerce\Config\ConfigUpdateResult
   *   The result.
   */
  public function delete(array $config_names);

  /**
   * Loads configuration from active storage.
   *
   * @param string $config_name
   *   The configuration name.
   *
   * @return array|false
   *   The configuration data, or FALSE if not found.
   */
  public function loadFromActive($config_name);

  /**
   * Loads configuration from extension storage.
   *
   * Extension storage represents the config/install or config/optional
   * directory of a module, theme, or install profile.
   *
   * @param string $config_name
   *   The configuration name.
   *
   * @return array|false
   *   The configuration data, or FALSE if not found.
   */
  public function loadFromExtension($config_name);

  /**
   * Checks whether the configuration was modified since the initial import.
   *
   * @param array $config
   *   The configuration data.
   *
   * @return bool
   *   TRUE if the configuration was modified, FALSE otherwise.
   */
  public function isModified(array $config);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigUpdaterInterface::delete public function Deletes configuration. 1
ConfigUpdaterInterface::import public function Imports configuration from extension storage to active storage. 1
ConfigUpdaterInterface::isModified public function Checks whether the configuration was modified since the initial import. 1
ConfigUpdaterInterface::loadFromActive public function Loads configuration from active storage. 1
ConfigUpdaterInterface::loadFromExtension public function Loads configuration from extension storage. 1
ConfigUpdaterInterface::revert public function Reverts configuration to the values from extension storage. 1