1 | <?php |
||
11 | class AssociationRule implements AssociationModelInterface |
||
12 | { |
||
13 | /** |
||
14 | * @var array |
||
15 | */ |
||
16 | private $orderMap = []; |
||
17 | |||
18 | /** |
||
19 | * @var array |
||
20 | */ |
||
21 | private $productMap = []; |
||
22 | |||
23 | /** |
||
24 | * @var ProductInterface[] |
||
25 | */ |
||
26 | private $products = []; |
||
27 | |||
28 | /** |
||
29 | * @param OrderInterface $order |
||
30 | */ |
||
31 | public function addOrder(OrderInterface $order) |
||
57 | |||
58 | /** |
||
59 | * @param array $array |
||
60 | * @param string $key |
||
61 | */ |
||
62 | private function addArrayIfKeyNotExists(array &$array, string $key) |
||
68 | |||
69 | /** |
||
70 | * @param ProductInterface $product |
||
71 | * @return array|Result[] |
||
72 | */ |
||
73 | public function getResult(ProductInterface $product) : array |
||
97 | |||
98 | /** |
||
99 | * @param string $id |
||
100 | * @return array |
||
101 | */ |
||
102 | private function getOrderIds(string $id): array |
||
106 | |||
107 | /** |
||
108 | * @param string $id |
||
109 | * @return array |
||
110 | */ |
||
111 | private function getProductIds(string $id): array |
||
115 | |||
116 | /** |
||
117 | * @return AssociationModelInterface |
||
118 | */ |
||
119 | public function exportModel() : AssociationModelInterface |
||
128 | |||
129 | /** |
||
130 | * @param array $orderIds |
||
131 | * @param string $productId |
||
132 | * @return array |
||
133 | */ |
||
134 | private function getOrderProducts(array $orderIds, string $productId): array |
||
150 | |||
151 | /** |
||
152 | * @return AssociationModel |
||
153 | */ |
||
154 | protected function getAssociationModel(): AssociationModel |
||
158 | } |