Total Complexity | 2 |
Total Lines | 29 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
25 | class SmartCollection extends AbstractCollection |
||
26 | { |
||
27 | |||
28 | const TYPE = 'smart_collection'; |
||
29 | const DIR = 'smart_collections'; |
||
30 | |||
31 | const MAP = [ |
||
32 | 'image' => Image::class, |
||
33 | 'rules' => [Rule::class], |
||
34 | ]; |
||
35 | |||
36 | /** |
||
37 | * @param Product $product |
||
38 | * @return SmartCollect |
||
39 | */ |
||
40 | public function newCollect(Product $product) |
||
41 | { |
||
42 | return $this->api->factory($this, SmartCollect::class, [ |
||
43 | 'collection_id' => $this->getId(), |
||
44 | 'product_id' => $product->getId() |
||
45 | ]); |
||
46 | } |
||
47 | |||
48 | /** |
||
49 | * @return Rule |
||
50 | */ |
||
51 | public function newRule() |
||
54 | } |
||
55 | } |