public function Promotion::getOffer in Commerce Core 8.2
Gets the offer.
Return value
\Drupal\commerce_promotion\Plugin\Commerce\PromotionOffer\PromotionOfferInterface|null The offer, or NULL if not yet available.
Overrides PromotionInterface::getOffer
2 calls to Promotion::getOffer()
- Promotion::apply in modules/
promotion/ src/ Entity/ Promotion.php - Applies the promotion to the given order.
- Promotion::clear in modules/
promotion/ src/ Entity/ Promotion.php - Allows a promotion to clean up any modifications done to the given order.
File
- modules/
promotion/ src/ Entity/ Promotion.php, line 251
Class
- Promotion
- Defines the promotion entity class.
Namespace
Drupal\commerce_promotion\EntityCode
public function getOffer() {
if (!$this
->get('offer')
->isEmpty()) {
return $this
->get('offer')
->first()
->getTargetInstance();
}
}