1 | <?php |
||
21 | class OneByOnePurchaseStrategy implements PurchaseStrategyInterface |
||
22 | { |
||
23 | use PurchaseResultTrait; |
||
24 | |||
25 | /** |
||
26 | * @var ShoppingCart |
||
27 | */ |
||
28 | protected $cart; |
||
29 | |||
30 | /** |
||
31 | * @var AbstractCartPosition[] |
||
32 | */ |
||
33 | protected $positions = []; |
||
34 | |||
35 | /** |
||
36 | * OneByOnePurchaseStrategy constructor. |
||
37 | * |
||
38 | * @param ShoppingCart $cart |
||
39 | */ |
||
40 | public function __construct(ShoppingCart $cart) |
||
44 | |||
45 | /** |
||
46 | * {@inheritdoc} |
||
47 | */ |
||
48 | public function addPosition(AbstractCartPosition $position) |
||
52 | |||
53 | /** |
||
54 | * {@inheritdoc} |
||
55 | */ |
||
56 | public function run() |
||
64 | |||
65 | protected function purchase(AbstractCartPosition $position) |
||
85 | } |
||
86 |