You are here

class FilterConditionsEvent in Commerce Core 8.2

Defines the event for filtering the available conditions.

Hierarchy

Expanded class hierarchy of FilterConditionsEvent

See also

\Drupal\commerce_payment\Event\PaymentEvents

3 files declare their use of FilterConditionsEvent
ConditionManager.php in src/ConditionManager.php
FilterConditionsEventSubscriber.php in modules/payment/src/EventSubscriber/FilterConditionsEventSubscriber.php
FilterConditionsEventSubscriber.php in modules/promotion/src/EventSubscriber/FilterConditionsEventSubscriber.php

File

src/Event/FilterConditionsEvent.php, line 12

Namespace

Drupal\commerce\Event
View source
class FilterConditionsEvent extends EventBase {

  /**
   * The condition definitions.
   *
   * @var array
   */
  protected $definitions;

  /**
   * The parent entity type ID.
   *
   * @var string
   */
  protected $parentEntityTypeId;

  /**
   * Constructs a new FilterConditionsEvent object.
   *
   * @param array $definitions
   *   The condition definitions.
   * @param string $parent_entity_type_id
   *   The parent entity type ID.
   */
  public function __construct(array $definitions, $parent_entity_type_id) {
    $this->definitions = $definitions;
    $this->parentEntityTypeId = $parent_entity_type_id;
  }

  /**
   * Gets the condition definitions.
   *
   * @return array
   *   The condition definitions.
   */
  public function getDefinitions() {
    return $this->definitions;
  }

  /**
   * Sets the condition definitions.
   *
   * @param array $definitions
   *   The condition definitions.
   *
   * @return $this
   */
  public function setDefinitions(array $definitions) {
    $this->definitions = $definitions;
    return $this;
  }

  /**
   * Gets the parent entity type ID.
   *
   * @return string
   *   The parent entity type ID.
   */
  public function getParentEntityTypeId() {
    return $this->parentEntityTypeId;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
FilterConditionsEvent::$definitions protected property The condition definitions.
FilterConditionsEvent::$parentEntityTypeId protected property The parent entity type ID.
FilterConditionsEvent::getDefinitions public function Gets the condition definitions.
FilterConditionsEvent::getParentEntityTypeId public function Gets the parent entity type ID.
FilterConditionsEvent::setDefinitions public function Sets the condition definitions.
FilterConditionsEvent::__construct public function Constructs a new FilterConditionsEvent object.