1 | <?php |
||
21 | class CollectionItem extends FakerModuleGenerator |
||
22 | { |
||
23 | |||
24 | /** |
||
25 | * Product model class instance |
||
26 | * @var \gplcart\core\models\Product $product |
||
27 | */ |
||
28 | protected $product; |
||
29 | |||
30 | /** |
||
31 | * Page model class instance |
||
32 | * @var \gplcart\core\models\Page $page |
||
33 | */ |
||
34 | protected $page; |
||
35 | |||
36 | /** |
||
37 | * Collection model class instance |
||
38 | * @var \gplcart\core\models\Collection $collection |
||
39 | */ |
||
40 | protected $collection; |
||
41 | |||
42 | /** |
||
43 | * Collection item model class instance |
||
44 | * @var \gplcart\core\models\CollectionItem $collection_item |
||
45 | */ |
||
46 | protected $collection_item; |
||
47 | |||
48 | /** |
||
49 | * @param CollectionModel $collection |
||
50 | * @param CollectionItemModel $collection_item |
||
51 | * @param ProductModel $product |
||
52 | * @param PageModel $page |
||
53 | */ |
||
54 | public function __construct(CollectionModel $collection, |
||
64 | |||
65 | /** |
||
66 | * Returns the generator name |
||
67 | * @return string |
||
68 | */ |
||
69 | public function getName() |
||
73 | |||
74 | /** |
||
75 | * Generate a single collection |
||
76 | * @return bool |
||
77 | */ |
||
78 | public function create() |
||
95 | |||
96 | /** |
||
97 | * Returns a random entity ID |
||
98 | * @staticvar array|null $items |
||
99 | * @param array $collection |
||
100 | * @return integer |
||
101 | */ |
||
102 | protected function getEntityId(array $collection) |
||
126 | |||
127 | /** |
||
128 | * Returns a random collection |
||
129 | * @staticvar array|null $collections |
||
130 | * @return array |
||
131 | */ |
||
132 | protected function getCollection() |
||
140 | |||
141 | } |
||
142 |