1 | <?php |
||
12 | class AssociationRule |
||
13 | { |
||
14 | /** |
||
15 | * @var array |
||
16 | */ |
||
17 | private $orderMap = []; |
||
18 | |||
19 | /** |
||
20 | * @var array |
||
21 | */ |
||
22 | private $productMap = []; |
||
23 | |||
24 | /** |
||
25 | * @var ProductInterface[] |
||
26 | */ |
||
27 | private $products = []; |
||
28 | |||
29 | /** |
||
30 | * @param OrderInterface $order |
||
31 | */ |
||
32 | public function addOrder(OrderInterface $order) |
||
58 | |||
59 | /** |
||
60 | * @param array $array |
||
61 | * @param string $key |
||
62 | */ |
||
63 | private function addArrayIfKeyNotExists(array &$array, string $key) |
||
69 | |||
70 | /** |
||
71 | * @param ProductInterface $product |
||
72 | * @return ResultSet |
||
73 | */ |
||
74 | public function getResult(ProductInterface $product) : ResultSet |
||
98 | |||
99 | /** |
||
100 | * @param string $id |
||
101 | * @return array |
||
102 | */ |
||
103 | private function getOrderIds(string $id): array |
||
107 | |||
108 | /** |
||
109 | * @param string $id |
||
110 | * @return array |
||
111 | */ |
||
112 | private function getProductIds(string $id): array |
||
116 | |||
117 | /** |
||
118 | * @param AssociationModel $associationModel |
||
119 | * @return AssociationModelInterface |
||
120 | */ |
||
121 | public function exportModel(AssociationModel $associationModel) : AssociationModelInterface |
||
129 | |||
130 | /** |
||
131 | * @param array $orderIds |
||
132 | * @param string $productId |
||
133 | * @return array |
||
134 | */ |
||
135 | private function getOrderProducts(array $orderIds, string $productId): array |
||
151 | } |