You are here

interface ConditionInterface in Commerce Core 8.2

Defines the interface for conditions.

Hierarchy

Expanded class hierarchy of ConditionInterface

All classes that implement ConditionInterface

3 files declare their use of ConditionInterface
OrderItemPromotionOfferBase.php in modules/promotion/src/Plugin/Commerce/PromotionOffer/OrderItemPromotionOfferBase.php
OrderItemQuantityTest.php in modules/promotion/tests/src/Unit/Plugin/Commerce/Condition/OrderItemQuantityTest.php
Promotion.php in modules/promotion/src/Entity/Promotion.php

File

src/Plugin/Commerce/Condition/ConditionInterface.php, line 14

Namespace

Drupal\commerce\Plugin\Commerce\Condition
View source
interface ConditionInterface extends ConfigurableInterface, DependentPluginInterface, PluginFormInterface, PluginInspectionInterface {

  /**
   * Gets the condition label.
   *
   * @return string
   *   The condition label.
   */
  public function getLabel();

  /**
   * Gets the condition display label.
   *
   * Shown in the condition UI when enabling/disabling a condition.
   *
   * @return string
   *   The condition display label.
   */
  public function getDisplayLabel();

  /**
   * Gets the condition entity type ID.
   *
   * This is the entity type ID of the entity passed to evaluate().
   *
   * @return string
   *   The condition's entity type ID.
   */
  public function getEntityTypeId();

  /**
   * Evaluates the condition.
   *
   * @param \Drupal\Core\Entity\EntityInterface $entity
   *   The entity.
   *
   * @return bool
   *   TRUE if the condition has been met, FALSE otherwise.
   */
  public function evaluate(EntityInterface $entity);

}

Members

Namesort descending Modifiers Type Description Overrides
ConditionInterface::evaluate public function Evaluates the condition. 20
ConditionInterface::getDisplayLabel public function Gets the condition display label. 1
ConditionInterface::getEntityTypeId public function Gets the condition entity type ID. 1
ConditionInterface::getLabel public function Gets the condition label. 1
ConfigurableInterface::defaultConfiguration public function Gets default configuration for this plugin. 11
ConfigurableInterface::getConfiguration public function Gets this plugin's configuration. 12
ConfigurableInterface::setConfiguration public function Sets the configuration for this plugin instance. 12
DependentPluginInterface::calculateDependencies public function Calculates dependencies for the configured plugin. 19
PluginFormInterface::buildConfigurationForm public function Form constructor. 36
PluginFormInterface::submitConfigurationForm public function Form submission handler. 32
PluginFormInterface::validateConfigurationForm public function Form validation handler. 18
PluginInspectionInterface::getPluginDefinition public function Gets the definition of the plugin implementation. 4
PluginInspectionInterface::getPluginId public function Gets the plugin_id of the plugin instance. 2