You are here

class CouponEvent in Commerce Core 8.2

Defines the coupon event.

Hierarchy

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

Expanded class hierarchy of CouponEvent

See also

\Drupal\commerce_promotion\Event\PromotionEvents

File

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

Namespace

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

  /**
   * The coupon.
   *
   * @var \Drupal\commerce_promotion\Entity\CouponInterface
   */
  protected $coupon;

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

  /**
   * Gets the coupon.
   *
   * @return \Drupal\commerce_promotion\Entity\CouponInterface
   *   The coupon.
   */
  public function getCoupon() {
    return $this->coupon;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
CouponEvent::$coupon protected property The coupon.
CouponEvent::getCoupon public function Gets the coupon.
CouponEvent::__construct public function Constructs a new CouponEvent.