1 | <?php |
||
28 | class CartItem extends \Eccube\Entity\AbstractEntity implements ItemInterface |
||
29 | { |
||
30 | use PointRateTrait; |
||
31 | |||
32 | /** |
||
33 | * @var integer |
||
34 | * |
||
35 | * @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
||
36 | * @ORM\Id |
||
37 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
38 | */ |
||
39 | private $id; |
||
40 | |||
41 | /** |
||
42 | * @var string |
||
43 | * |
||
44 | * @ORM\Column(name="price", type="decimal", precision=12, scale=2, options={"default":0}) |
||
45 | */ |
||
46 | private $price = 0; |
||
47 | |||
48 | /** |
||
49 | * @var string |
||
50 | * |
||
51 | * @ORM\Column(name="quantity", type="decimal", precision=10, scale=0, options={"default":0}) |
||
52 | */ |
||
53 | private $quantity = 0; |
||
54 | |||
55 | /** |
||
56 | * @var \Eccube\Entity\ProductClass |
||
57 | * |
||
58 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\ProductClass") |
||
59 | * @ORM\JoinColumns({ |
||
60 | * @ORM\JoinColumn(name="product_class_id", referencedColumnName="id") |
||
61 | * }) |
||
62 | */ |
||
63 | private $ProductClass; |
||
64 | |||
65 | /** |
||
66 | * @var \Eccube\Entity\Cart |
||
67 | * |
||
68 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Cart", inversedBy="CartItems") |
||
69 | * @ORM\JoinColumns({ |
||
70 | * @ORM\JoinColumn(name="cart_id", referencedColumnName="id", onDelete="CASCADE") |
||
71 | * }) |
||
72 | */ |
||
73 | private $Cart; |
||
74 | |||
75 | /** |
||
76 | * sessionのシリアライズのために使われる |
||
77 | * |
||
78 | * @var int |
||
79 | */ |
||
80 | private $product_class_id; |
||
81 | |||
82 | public function __sleep() |
||
86 | |||
87 | /** |
||
88 | * @return int |
||
89 | */ |
||
90 | public function getId() |
||
94 | 92 | ||
95 | /** |
||
96 | 92 | * @param integer $price |
|
97 | * |
||
98 | * @return CartItem |
||
99 | */ |
||
100 | public function setPrice($price) |
||
106 | |||
107 | /** |
||
108 | * @return string |
||
109 | */ |
||
110 | public function getPrice() |
||
114 | 95 | ||
115 | /** |
||
116 | 95 | * @param integer $quantity |
|
117 | * |
||
118 | * @return CartItem |
||
119 | */ |
||
120 | public function setQuantity($quantity) |
||
126 | |||
127 | /** |
||
128 | * @return string |
||
129 | */ |
||
130 | 16 | public function getQuantity() |
|
134 | |||
135 | /** |
||
136 | * @return integer |
||
137 | */ |
||
138 | public function getTotalPrice() |
||
142 | 89 | ||
143 | /** |
||
144 | * 商品明細かどうか. |
||
145 | * |
||
146 | * @return boolean 商品明細の場合 true |
||
147 | */ |
||
148 | public function isProduct() |
||
152 | 79 | ||
153 | /** |
||
154 | * 送料明細かどうか. |
||
155 | * |
||
156 | * @return boolean 送料明細の場合 true |
||
157 | */ |
||
158 | public function isDeliveryFee() |
||
162 | 79 | ||
163 | /** |
||
164 | * 手数料明細かどうか. |
||
165 | * |
||
166 | * @return boolean 手数料明細の場合 true |
||
167 | */ |
||
168 | public function isCharge() |
||
172 | 79 | ||
173 | /** |
||
174 | * 値引き明細かどうか. |
||
175 | * |
||
176 | * @return boolean 値引き明細の場合 true |
||
177 | */ |
||
178 | public function isDiscount() |
||
182 | |||
183 | /** |
||
184 | * 税額明細かどうか. |
||
185 | * |
||
186 | * @return boolean 税額明細の場合 true |
||
187 | */ |
||
188 | public function isTax() |
||
192 | 79 | ||
193 | /** |
||
194 | * ポイント明細かどうか. |
||
195 | 17 | * |
|
196 | * @return boolean ポイント明細の場合 true |
||
197 | */ |
||
198 | 17 | public function isPoint() |
|
202 | |||
203 | public function getOrderItemType() |
||
210 | 110 | ||
211 | /** |
||
212 | 110 | * @param ProductClass $ProductClass |
|
213 | 110 | * |
|
214 | * @return $this |
||
215 | 110 | */ |
|
216 | public function setProductClass(ProductClass $ProductClass) |
||
225 | |||
226 | /** |
||
227 | * @return ProductClass |
||
228 | */ |
||
229 | 37 | public function getProductClass() |
|
233 | |||
234 | 79 | /** |
|
235 | * @return int|null |
||
236 | */ |
||
237 | 79 | public function getProductClassId() |
|
241 | |||
242 | public function getPriceIncTax() |
||
247 | |||
248 | /** |
||
249 | * @return Cart |
||
250 | */ |
||
251 | 88 | public function getCart() |
|
255 | |||
256 | /** |
||
257 | * @param Cart $Cart |
||
258 | */ |
||
259 | public function setCart(Cart $Cart) |
||
263 | } |
||
264 | } |
||
265 |
This check looks for assignments to scalar types that may be of the wrong type.
To ensure the code behaves as expected, it may be a good idea to add an explicit type cast.