You are here

public function CouponStorage::loadMultipleByPromotion in Commerce Core 8.2

Loads all coupons for the given promotion.

Parameters

\Drupal\commerce_promotion\Entity\PromotionInterface $promotion: The promotion.

Return value

\Drupal\commerce_promotion\Entity\CouponInterface[] The coupons.

Overrides CouponStorageInterface::loadMultipleByPromotion

File

modules/promotion/src/CouponStorage.php, line 24

Class

CouponStorage
Defines the coupon storage.

Namespace

Drupal\commerce_promotion

Code

public function loadMultipleByPromotion(PromotionInterface $promotion) {
  return $this
    ->loadByProperties([
    'promotion_id' => $promotion
      ->id(),
  ]);
}