You are here

PromotionEvent.php in Commerce Core 8.2

File

modules/promotion/src/Event/PromotionEvent.php
View source
<?php

namespace Drupal\commerce_promotion\Event;

use Drupal\commerce\EventBase;
use Drupal\commerce_promotion\Entity\PromotionInterface;

/**
 * Defines the promotion event.
 *
 * @see \Drupal\commerce_promotion\Event\PromotionEvents
 */
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;
  }

}

Classes

Namesort descending Description
PromotionEvent Defines the promotion event.