class CouponEvent in Commerce Core 8.2
Defines the coupon event.
Hierarchy
- class \Drupal\commerce\EventBase extends \Drupal\Component\EventDispatcher\Event
- class \Drupal\commerce_promotion\Event\CouponEvent
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\EventView 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
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
CouponEvent:: |
protected | property | The coupon. | |
CouponEvent:: |
public | function | Gets the coupon. | |
CouponEvent:: |
public | function | Constructs a new CouponEvent. |