1 | <?php |
||
13 | class OneByOnePurchaseStrategy implements PurchaseStrategyInterface |
||
14 | { |
||
15 | use PurchaseResultTrait; |
||
16 | |||
17 | /** |
||
18 | * @var ShoppingCart |
||
19 | */ |
||
20 | protected $cart; |
||
21 | |||
22 | /** |
||
23 | * @var AbstractCartPosition[] |
||
24 | */ |
||
25 | protected $positions = []; |
||
26 | |||
27 | /** |
||
28 | * OneByOnePurchaseStrategy constructor. |
||
29 | * |
||
30 | * @param ShoppingCart $cart |
||
31 | */ |
||
32 | public function __construct(ShoppingCart $cart) |
||
36 | |||
37 | /** |
||
38 | * {@inheritdoc} |
||
39 | */ |
||
40 | public function addPosition(AbstractCartPosition $position) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function run() |
||
56 | |||
57 | protected function purchase(AbstractCartPosition $position) |
||
76 | } |
||
77 |