1 | <?php |
||
19 | class Review extends FakerModuleGenerator |
||
20 | { |
||
21 | |||
22 | /** |
||
23 | * Review model instance |
||
24 | * @var \gplcart\core\models\Review $review |
||
25 | */ |
||
26 | protected $review; |
||
27 | |||
28 | /** |
||
29 | * Product model instance |
||
30 | * @var \gplcart\core\models\Product $product |
||
31 | */ |
||
32 | protected $product; |
||
33 | |||
34 | /** |
||
35 | * @param ReviewModel $review |
||
36 | * @param ProductModel $product |
||
37 | */ |
||
38 | public function __construct(ReviewModel $review, ProductModel $product) |
||
45 | |||
46 | /** |
||
47 | * Returns the generator name |
||
48 | * @return string |
||
49 | */ |
||
50 | public function getName() |
||
54 | |||
55 | /** |
||
56 | * Generate a single review |
||
57 | * @return bool |
||
58 | */ |
||
59 | public function create() |
||
74 | |||
75 | /** |
||
76 | * Get a random product ID |
||
77 | * @staticvar array|null $products |
||
78 | * @return integer |
||
79 | */ |
||
80 | protected function getProductId() |
||
88 | |||
89 | } |
||
90 |