1 | <?php |
||
19 | class OrderProduct implements EntityInterface |
||
20 | { |
||
21 | use Identifiable; |
||
22 | use Timestampable; |
||
23 | use OrderProductExtraTrait; |
||
24 | |||
25 | protected $quantity = 1; |
||
26 | protected $weight = 0.00; |
||
27 | protected $options = []; |
||
28 | protected $locked = false; |
||
29 | |||
30 | /** |
||
31 | * @var Price |
||
32 | */ |
||
33 | protected $buyPrice; |
||
34 | |||
35 | /** |
||
36 | * @var Price |
||
37 | */ |
||
38 | protected $sellPrice; |
||
39 | |||
40 | /** |
||
41 | * @var Order |
||
42 | */ |
||
43 | protected $order; |
||
44 | |||
45 | /** |
||
46 | * @var Product |
||
47 | */ |
||
48 | protected $product; |
||
49 | |||
50 | /** |
||
51 | * @var Variant |
||
52 | */ |
||
53 | protected $variant; |
||
54 | |||
55 | public function __construct() |
||
60 | |||
61 | public function getCurrentStock(): int |
||
69 | |||
70 | public function getCurrentSellPrice(): DiscountablePrice |
||
78 | |||
79 | public function getCurrentWeight(): float |
||
87 | |||
88 | public function getQuantity(): int |
||
92 | |||
93 | public function setQuantity(int $quantity) |
||
97 | |||
98 | public function increaseQuantity(int $increase) |
||
102 | |||
103 | public function decreaseQuantity(int $decrease) |
||
107 | |||
108 | public function getSellPrice(): Price |
||
112 | |||
113 | public function setSellPrice(Price $sellPrice) |
||
117 | |||
118 | public function getBuyPrice(): Price |
||
122 | |||
123 | public function setBuyPrice(Price $buyPrice) |
||
127 | |||
128 | public function getWeight(): float |
||
132 | |||
133 | public function setWeight(float $weight) |
||
137 | |||
138 | public function getOptions(): array |
||
142 | |||
143 | public function setOptions(array $options) |
||
147 | |||
148 | public function isLocked(): bool |
||
152 | |||
153 | public function setLocked(bool $locked) |
||
157 | |||
158 | public function getOrder(): Order |
||
162 | |||
163 | public function setOrder(Order $order = null) |
||
167 | |||
168 | public function getProduct(): Product |
||
172 | |||
173 | public function setProduct(Product $product) |
||
177 | |||
178 | public function getVariant() |
||
182 | |||
183 | public function setVariant(Variant $variant) |
||
187 | |||
188 | public function hasVariant(): bool |
||
192 | } |
||
193 |