-
Notifications
You must be signed in to change notification settings - Fork 252
Expand file tree
/
Copy pathPromotionStorageInterface.php
More file actions
54 lines (47 loc) · 1.77 KB
/
PromotionStorageInterface.php
File metadata and controls
54 lines (47 loc) · 1.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
namespace Drupal\commerce_promotion;
use Drupal\commerce_order\Entity\OrderTypeInterface;
use Drupal\commerce_promotion\Entity\CouponInterface;
use Drupal\commerce_store\Entity\StoreInterface;
use Drupal\Core\Entity\ContentEntityStorageInterface;
/**
* Defines the interface for promotion storage.
*/
interface PromotionStorageInterface extends ContentEntityStorageInterface {
/**
* Loads the valid promotions for the given order type and store.
*
* @param \Drupal\commerce_order\Entity\OrderTypeInterface $order_type
* The order type.
* @param \Drupal\commerce_store\Entity\StoreInterface $store
* The store.
*
* @return \Drupal\commerce_promotion\Entity\PromotionInterface[]
* The valid promotions.
*/
public function loadValid(OrderTypeInterface $order_type, StoreInterface $store);
/**
* Loads the valid promotions for the given coupon.
*
* @param \Drupal\commerce_order\Entity\OrderTypeInterface $order_type
* The order type.
* @param \Drupal\commerce_store\Entity\StoreInterface $store
* The store.
* @param \Drupal\commerce_promotion\Entity\CouponInterface $coupon
* The coupon.
*
* @return \Drupal\commerce_promotion\Entity\PromotionInterface
* The valid promotions.
*/
public function loadByCoupon(OrderTypeInterface $order_type, StoreInterface $store, CouponInterface $coupon);
/**
* Builds a query that will load all promotions that are no longer valid
* determined by the base field limiting values.
*
* @param bool $only_enabled
* Only include currently enabled promotions that have expired.
* @return array|bool|\Drupal\Core\Entity\EntityInterface[]
* The expired promotion entities. Returns FALSE if none found.
*/
public function loadExpired($only_enabled);
}