interface ContextInterface

Same name in this branch
  1. 8.x drupal/core/lib/Drupal/Component/Plugin/Context/ContextInterface.php \Drupal\Component\Plugin\Context\ContextInterface
  2. 8.x drupal/core/lib/Drupal/Core/Config/Context/ContextInterface.php \Drupal\Core\Config\Context\ContextInterface

Defines the configuration context interface.

The configuration context object will contain predefined parameters used by the configuration object for storage operations and notifications and contextual data to be used by configuration event listeners.

Hierarchy

Expanded class hierarchy of ContextInterface

All classes that implement ContextInterface

See also

Drupal\Core\Config\Config

Drupal\Core\Config\ConfigFactory

config()

12 files declare their use of ContextInterface
AccountSettingsForm.php in drupal/core/modules/user/lib/Drupal/user/AccountSettingsForm.php
Contains \Drupal\user\AccountSettingsForm.
Config.php in drupal/core/lib/Drupal/Core/Config/Config.php
Definition of Drupal\Core\Config\Config.
ConfigEvent.php in drupal/core/lib/Drupal/Core/Config/ConfigEvent.php
ConfigFactory.php in drupal/core/lib/Drupal/Core/Config/ConfigFactory.php
Definition of Drupal\Core\Config\ConfigFactory.
CronForm.php in drupal/core/modules/system/lib/Drupal/system/Form/CronForm.php
Contains \Drupal\system\Form\CronForm.

... See full list

1 string reference to 'ContextInterface'
core.services.yml in drupal/core/core.services.yml
drupal/core/core.services.yml

File

drupal/core/lib/Drupal/Core/Config/Context/ContextInterface.php, line 23
Contains \Drupal\Core\Config\Context\ContextInterface.

Namespace

Drupal\Core\Config\Context
View source
interface ContextInterface {

  /**
   * Initializes a configuration context for use.
   *
   * @return \Drupal\Core\Config\Context\ConfigContext
   *   The config context object.
   */
  public function init();

  /**
   * Returns the stored value for a given key.
   *
   * @param string $key
   *   The key of the data to retrieve.
   *
   * @return mixed
   *   The stored value, or NULL if no value exists.
   */
  public function get($key);

  /**
   * Saves a value for a given key.
   *
   * @param string $key
   *   The key of the data to store.
   * @param mixed $value
   *   The data to store.
   */
  public function set($key, $value);

  /**
   * Sets the uuid for the context.
   *
   * @return string
   *   The context's uuid.
   */
  public function setUuid();

  /**
   * Gets the uuid for the context.
   *
   * @return string
   *   The context's uuid.
   */
  public function getUuid();

  /**
   * Dispatches a config event.
   *
   * @param string $config_event_name
   *   Event name.
   * @param \Drupal\Core\Config\Config $config
   *   (optional) Configuration object.
   */
  public function notify($config_event_name, Config $config = NULL);

  /**
   * Sets the override data for a configuration object.
   *
   * @param string $config_name
   *   Configuration name.
   * @param array data
   *   The override data.
   */
  public function setOverrides($config_name, $data);

  /**
   * Gets the override data for a configuration object.
   *
   * @param string $config_name
   *   Configuration name.
   *
   * @return mixed
   *   The override data or FALSE if there is none.
   */
  public function getOverrides($config_name);

}

Members

Namesort descending Modifiers Type Description Overrides
ContextInterface::get public function Returns the stored value for a given key. 1
ContextInterface::getOverrides public function Gets the override data for a configuration object. 1
ContextInterface::getUuid public function Gets the uuid for the context. 1
ContextInterface::init public function Initializes a configuration context for use. 1
ContextInterface::notify public function Dispatches a config event. 1
ContextInterface::set public function Saves a value for a given key. 1
ContextInterface::setOverrides public function Sets the override data for a configuration object. 1
ContextInterface::setUuid public function Sets the uuid for the context. 1