You are here

interface ConfigRevertInterface in Configuration Update Manager 8

Defines an interface for config import and revert operations.

Hierarchy

Expanded class hierarchy of ConfigRevertInterface

All classes that implement ConfigRevertInterface

5 files declare their use of ConfigRevertInterface
ConfigDeleteConfirmForm.php in config_update_ui/src/Form/ConfigDeleteConfirmForm.php
ConfigImportConfirmForm.php in config_update_ui/src/Form/ConfigImportConfirmForm.php
ConfigRevertConfirmForm.php in config_update_ui/src/Form/ConfigRevertConfirmForm.php
ConfigReverterTest.php in tests/src/Unit/ConfigReverterTest.php
ConfigUpdateController.php in config_update_ui/src/Controller/ConfigUpdateController.php

File

src/ConfigRevertInterface.php, line 8

Namespace

Drupal\config_update
View source
interface ConfigRevertInterface {

  /**
   * Name of the event triggered on configuration import.
   *
   * @see \Drupal\config_update\ConfigRevertEvent
   * @see \Drupal\config_update\ConfigRevertInterface::import()
   */
  const IMPORT = 'config_update.import';

  /**
   * Name of the event triggered on configuration revert.
   *
   * @see \Drupal\config_update\ConfigRevertEvent
   * @see \Drupal\config_update\ConfigRevertInterface::revert()
   */
  const REVERT = 'config_update.revert';

  /**
   * Imports configuration from extension storage to active storage.
   *
   * This action triggers a ConfigRevertInterface::IMPORT event if the
   * configuration could be imported.
   *
   * @param string $type
   *   The type of configuration.
   * @param string $name
   *   The name of the config item, without the prefix.
   *
   * @return bool
   *   TRUE if the operation succeeded; FALSE if the configuration could not
   *   be found to import. May also throw exceptions if there is a problem
   *   during saving the configuration.
   *
   * @see \Drupal\config_update\ConfigRevertInterface::IMPORT
   */
  public function import($type, $name);

  /**
   * Reverts configuration to the value from extension storage.
   *
   * This action triggers a ConfigRevertInterface::REVERT event.
   *
   * @param string $type
   *   The type of configuration.
   * @param string $name
   *   The name of the config item, without the prefix.
   *
   * @return bool
   *   TRUE if the operation succeeded; FALSE if the base configuration could
   *   not be found to revert to. May also throw exceptions if there is a
   *   problem during saving the configuration.
   *
   * @see \Drupal\config_update\ConfigRevertInterface::REVERT
   */
  public function revert($type, $name);

  /**
   * Gets the current active value of configuration.
   *
   * @param string $type
   *   The type of configuration. Or pass '' to indicate that $name is the full
   *   name.
   * @param string $name
   *   The name of the config item, without the prefix.
   *
   * @return array
   *   The configuration value, or FALSE if it is not found.
   */
  public function getFromActive($type, $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 $type
   *   The type of configuration. Or pass '' to indicate that $name is the full
   *   name.
   * @param string $name
   *   The name of the config item, without the prefix.
   *
   * @return array|false
   *   The configuration value, or FALSE if it could not be located.
   */
  public function getFromExtension($type, $name);

}

Members

Namesort descending Modifiers Type Description Overrides
ConfigRevertInterface::getFromActive public function Gets the current active value of configuration. 1
ConfigRevertInterface::getFromExtension public function Gets the extension storage value of configuration. 1
ConfigRevertInterface::import public function Imports configuration from extension storage to active storage. 1
ConfigRevertInterface::IMPORT constant Name of the event triggered on configuration import.
ConfigRevertInterface::revert public function Reverts configuration to the value from extension storage. 1
ConfigRevertInterface::REVERT constant Name of the event triggered on configuration revert.