You are here

class PromotionEvent in Commerce Core 8.2

Defines the promotion event.

Hierarchy

  • class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event

Expanded class hierarchy of PromotionEvent

See also

\Drupal\commerce_promotion\Event\PromotionEvents

File

modules/promotion/src/Event/PromotionEvent.php, line 13

Namespace

Drupal\commerce_promotion\Event
View source
class PromotionEvent extends EventBase {

  /**
   * The promotion.
   *
   * @var \Drupal\commerce_promotion\Entity\PromotionInterface
   */
  protected $promotion;

  /**
   * Constructs a new PromotionEvent.
   *
   * @param \Drupal\commerce_promotion\Entity\PromotionInterface $promotion
   *   The promotion.
   */
  public function __construct(PromotionInterface $promotion) {
    $this->promotion = $promotion;
  }

  /**
   * Gets the promotion.
   *
   * @return \Drupal\commerce_promotion\Entity\PromotionInterface
   *   The promotion.
   */
  public function getPromotion() {
    return $this->promotion;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PromotionEvent::$promotion protected property The promotion.
PromotionEvent::getPromotion public function Gets the promotion.
PromotionEvent::__construct public function Constructs a new PromotionEvent.