interface ConditionInterface

Same name in this branch
  1. 8.x drupal/core/lib/Drupal/Core/Condition/ConditionInterface.php \Drupal\Core\Condition\ConditionInterface
  2. 8.x drupal/core/lib/Drupal/Core/Database/Query/ConditionInterface.php \Drupal\Core\Database\Query\ConditionInterface
  3. 8.x drupal/core/lib/Drupal/Core/Entity/Query/ConditionInterface.php \Drupal\Core\Entity\Query\ConditionInterface

An interface for condition plugins.

Condition plugins are context-aware and configurable. They support the following keys in their plugin definitions:

  • context: An array of context definitions, keyed by context name. Each context definition is a typed data definition describing the context. Check the typed data definition docs for details.
  • configuration: An array of configuration option definitions, keyed by option name. Each option definition is a typed data definition describing the configuration option. Check the typed data definition docs for details.

@todo Replace the dependency on \Drupal\Core\Form\FormInterface with a new interface from https://drupal.org/node/2006248.

Hierarchy

Expanded class hierarchy of ConditionInterface

All classes that implement ConditionInterface

See also

\Drupal\Core\TypedData\TypedDataManager::create()

\Drupal\Core\Executable\ExecutableInterface

File

drupal/core/lib/Drupal/Core/Condition/ConditionInterface.php, line 32
Contains \Drupal\Core\Condition\ConditionInterface.

Namespace

Drupal\Core\Condition
View source
interface ConditionInterface extends ExecutableInterface, FormInterface {

  /**
   * Determines whether condition result will be negated.
   *
   * @return boolean
   *   Whether the condition result will be negated.
   */
  public function isNegated();

  /**
   * Evaluates the condition and returns TRUE or FALSE accordingly.
   *
   * @return bool
   *   TRUE if the condition has been met, FALSE otherwise.
   */
  public function evaluate();

  /**
   * Provides a human readable summary of the condition's configuration.
   */
  public function summary();

  /**
   * Sets the executable manager class.
   *
   * @param \Drupal\Core\Executable\ExecutableManagerInterface $executableManager
   *   The executable manager.
   */
  public function setExecutableManager(ExecutableManagerInterface $executableManager);

}

Members

Namesort descending Modifiers Type Description Overrides
ConditionInterface::evaluate public function Evaluates the condition and returns TRUE or FALSE accordingly. 3
ConditionInterface::isNegated public function Determines whether condition result will be negated. 1
ConditionInterface::setExecutableManager public function Sets the executable manager class.
ConditionInterface::summary public function Provides a human readable summary of the condition's configuration. 3
ExecutableInterface::execute public function Executes the plugin. 25
FormInterface::buildForm public function Form constructor. 36
FormInterface::getFormID public function Returns a unique string identifying the form. 90
FormInterface::submitForm public function Form submission handler. 55
FormInterface::validateForm public function Form validation handler. 27