1 | <?php |
||
21 | final class PromotionContext implements Context |
||
22 | { |
||
23 | /** |
||
24 | * @var PromotionRepositoryInterface |
||
25 | */ |
||
26 | private $promotionRepository; |
||
27 | |||
28 | /** |
||
29 | * @var RepositoryInterface |
||
30 | */ |
||
31 | private $couponRepository; |
||
32 | |||
33 | /** |
||
34 | * @param PromotionRepositoryInterface $promotionRepository |
||
35 | * @param RepositoryInterface $couponRepository |
||
36 | */ |
||
37 | public function __construct( |
||
44 | |||
45 | /** |
||
46 | * @Transform /^promotion "([^"]+)"$/ |
||
47 | * @Transform /^"([^"]+)" promotion$/ |
||
48 | * @Transform :promotion |
||
49 | */ |
||
50 | public function getPromotionByName($promotionName) |
||
61 | |||
62 | /** |
||
63 | * @Transform /^coupon "([^"]+)"$/ |
||
64 | * @Transform /^"([^"]+)" coupon$/ |
||
65 | * @Transform :coupon |
||
66 | */ |
||
67 | public function getCouponByCode($couponCode) |
||
78 | } |
||
79 |