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