These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more
1 | <?php |
||
2 | |||
3 | /* |
||
4 | * This file is part of EC-CUBE |
||
5 | * |
||
6 | * Copyright(c) EC-CUBE CO.,LTD. All Rights Reserved. |
||
7 | * |
||
8 | * http://www.ec-cube.co.jp/ |
||
9 | * |
||
10 | * For the full copyright and license information, please view the LICENSE |
||
11 | * file that was distributed with this source code. |
||
12 | */ |
||
13 | |||
14 | namespace Eccube\Entity; |
||
15 | |||
16 | use Doctrine\ORM\Mapping as ORM; |
||
17 | |||
18 | 1 | if (!class_exists('\Eccube\Entity\Payment')) { |
|
19 | /** |
||
20 | * Payment |
||
21 | * |
||
22 | * @ORM\Table(name="dtb_payment") |
||
23 | * @ORM\InheritanceType("SINGLE_TABLE") |
||
24 | * @ORM\DiscriminatorColumn(name="discriminator_type", type="string", length=255) |
||
25 | * @ORM\HasLifecycleCallbacks() |
||
26 | * @ORM\Entity(repositoryClass="Eccube\Repository\PaymentRepository") |
||
27 | */ |
||
28 | class Payment extends \Eccube\Entity\AbstractEntity |
||
29 | { |
||
30 | /** |
||
31 | * @return string |
||
32 | */ |
||
33 | 5 | public function __toString() |
|
34 | { |
||
35 | 5 | return (string) $this->getMethod(); |
|
36 | } |
||
37 | |||
38 | /** |
||
39 | * @var int |
||
40 | * |
||
41 | * @ORM\Column(name="id", type="integer", options={"unsigned":true}) |
||
42 | * @ORM\Id |
||
43 | * @ORM\GeneratedValue(strategy="IDENTITY") |
||
44 | */ |
||
45 | private $id; |
||
46 | |||
47 | /** |
||
48 | * @var string|null |
||
49 | * |
||
50 | * @ORM\Column(name="payment_method", type="string", length=255, nullable=true) |
||
51 | */ |
||
52 | private $method; |
||
53 | |||
54 | /** |
||
55 | * @var string|null |
||
56 | * |
||
57 | * @ORM\Column(name="charge", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true,"default":0}) |
||
58 | */ |
||
59 | private $charge = 0; |
||
60 | |||
61 | /** |
||
62 | * @var string|null |
||
63 | * |
||
64 | * @ORM\Column(name="rule_max", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true}) |
||
65 | */ |
||
66 | private $rule_max; |
||
67 | |||
68 | /** |
||
69 | * @var int|null |
||
70 | * |
||
71 | * @ORM\Column(name="sort_no", type="smallint", nullable=true, options={"unsigned":true}) |
||
72 | */ |
||
73 | private $sort_no; |
||
74 | |||
75 | /** |
||
76 | * @var boolean |
||
77 | * |
||
78 | * @ORM\Column(name="fixed", type="boolean", options={"default":true}) |
||
79 | */ |
||
80 | private $fixed = true; |
||
81 | |||
82 | /** |
||
83 | * @var string|null |
||
84 | * |
||
85 | * @ORM\Column(name="payment_image", type="string", length=255, nullable=true) |
||
86 | */ |
||
87 | private $payment_image; |
||
88 | |||
89 | /** |
||
90 | * @var string|null |
||
91 | * |
||
92 | * @ORM\Column(name="rule_min", type="decimal", precision=12, scale=2, nullable=true, options={"unsigned":true}) |
||
93 | */ |
||
94 | private $rule_min; |
||
95 | |||
96 | /** |
||
97 | * @var string|null |
||
98 | * |
||
99 | * @ORM\Column(name="method_class", type="string", length=255, nullable=true) |
||
100 | */ |
||
101 | private $method_class; |
||
102 | |||
103 | /** |
||
104 | * @var int |
||
105 | * |
||
106 | * @ORM\Column(name="visible", type="boolean", options={"default":true}) |
||
107 | */ |
||
108 | private $visible; |
||
109 | |||
110 | /** |
||
111 | * @var \DateTime |
||
112 | * |
||
113 | * @ORM\Column(name="create_date", type="datetimetz") |
||
114 | */ |
||
115 | private $create_date; |
||
116 | |||
117 | /** |
||
118 | * @var \DateTime |
||
119 | * |
||
120 | * @ORM\Column(name="update_date", type="datetimetz") |
||
121 | */ |
||
122 | private $update_date; |
||
123 | |||
124 | /** |
||
125 | * @var \Doctrine\Common\Collections\Collection |
||
126 | * |
||
127 | * @ORM\OneToMany(targetEntity="Eccube\Entity\PaymentOption", mappedBy="Payment") |
||
128 | */ |
||
129 | private $PaymentOptions; |
||
130 | |||
131 | /** |
||
132 | * @var \Eccube\Entity\Member |
||
133 | * |
||
134 | * @ORM\ManyToOne(targetEntity="Eccube\Entity\Member") |
||
135 | * @ORM\JoinColumns({ |
||
136 | * @ORM\JoinColumn(name="creator_id", referencedColumnName="id") |
||
137 | * }) |
||
138 | */ |
||
139 | private $Creator; |
||
140 | |||
141 | /** |
||
142 | * Constructor |
||
143 | */ |
||
144 | 25 | public function __construct() |
|
145 | { |
||
146 | 25 | $this->PaymentOptions = new \Doctrine\Common\Collections\ArrayCollection(); |
|
147 | } |
||
148 | |||
149 | /** |
||
150 | * Get id. |
||
151 | * |
||
152 | * @return int |
||
153 | */ |
||
154 | 227 | public function getId() |
|
155 | { |
||
156 | 227 | return $this->id; |
|
157 | } |
||
158 | |||
159 | /** |
||
160 | * Set method. |
||
161 | * |
||
162 | * @param string|null $method |
||
163 | * |
||
164 | * @return Payment |
||
165 | */ |
||
166 | 20 | public function setMethod($method = null) |
|
167 | { |
||
168 | 20 | $this->method = $method; |
|
169 | |||
170 | 20 | return $this; |
|
171 | } |
||
172 | |||
173 | /** |
||
174 | * Get method. |
||
175 | * |
||
176 | * @return string|null |
||
177 | */ |
||
178 | 250 | public function getMethod() |
|
179 | { |
||
180 | 250 | return $this->method; |
|
181 | } |
||
182 | |||
183 | /** |
||
184 | * Set charge. |
||
185 | * |
||
186 | * @param string|null $charge |
||
187 | * |
||
188 | * @return Payment |
||
189 | */ |
||
190 | 15 | public function setCharge($charge = null) |
|
191 | { |
||
192 | 15 | $this->charge = $charge; |
|
193 | |||
194 | 15 | return $this; |
|
195 | } |
||
196 | |||
197 | /** |
||
198 | * Get charge. |
||
199 | * |
||
200 | * @return string|null |
||
201 | */ |
||
202 | 17 | public function getCharge() |
|
203 | { |
||
204 | 17 | return $this->charge; |
|
205 | } |
||
206 | |||
207 | /** |
||
208 | * Set ruleMax. |
||
209 | * |
||
210 | * @param string|null $ruleMax |
||
211 | * |
||
212 | * @return Payment |
||
213 | */ |
||
214 | 15 | public function setRuleMax($ruleMax = null) |
|
215 | { |
||
216 | 15 | $this->rule_max = $ruleMax; |
|
217 | |||
218 | 15 | return $this; |
|
219 | } |
||
220 | |||
221 | /** |
||
222 | * Get ruleMax. |
||
223 | * |
||
224 | * @return string|null |
||
225 | */ |
||
226 | 17 | public function getRuleMax() |
|
227 | { |
||
228 | 17 | return $this->rule_max; |
|
229 | } |
||
230 | |||
231 | /** |
||
232 | * Set sortNo. |
||
233 | * |
||
234 | * @param int|null $sortNo |
||
235 | * |
||
236 | * @return Payment |
||
237 | */ |
||
238 | 12 | public function setSortNo($sortNo = null) |
|
239 | { |
||
240 | 12 | $this->sort_no = $sortNo; |
|
241 | |||
242 | 12 | return $this; |
|
243 | } |
||
244 | |||
245 | /** |
||
246 | * Get sortNo. |
||
247 | * |
||
248 | * @return int|null |
||
249 | */ |
||
250 | 12 | public function getSortNo() |
|
251 | { |
||
252 | 12 | return $this->sort_no; |
|
253 | } |
||
254 | |||
255 | /** |
||
256 | * Set fixed. |
||
257 | * |
||
258 | * @param boolean $fixed |
||
259 | * |
||
260 | * @return Payment |
||
261 | */ |
||
262 | 21 | public function setFixed($fixed) |
|
263 | { |
||
264 | 21 | $this->fixed = $fixed; |
|
265 | |||
266 | 21 | return $this; |
|
267 | } |
||
268 | |||
269 | /** |
||
270 | * Get fixed. |
||
271 | * |
||
272 | * @return boolean |
||
273 | */ |
||
274 | 17 | public function isFixed() |
|
275 | { |
||
276 | 17 | return $this->fixed; |
|
277 | } |
||
278 | |||
279 | /** |
||
280 | * Set paymentImage. |
||
281 | * |
||
282 | * @param string|null $paymentImage |
||
283 | * |
||
284 | * @return Payment |
||
285 | */ |
||
286 | 4 | public function setPaymentImage($paymentImage = null) |
|
287 | { |
||
288 | 4 | $this->payment_image = $paymentImage; |
|
289 | |||
290 | 4 | return $this; |
|
291 | } |
||
292 | |||
293 | /** |
||
294 | * Get paymentImage. |
||
295 | * |
||
296 | * @return string|null |
||
297 | */ |
||
298 | 62 | public function getPaymentImage() |
|
299 | { |
||
300 | 62 | return $this->payment_image; |
|
301 | } |
||
302 | |||
303 | /** |
||
304 | * Set ruleMin. |
||
305 | * |
||
306 | * @param string|null $ruleMin |
||
307 | * |
||
308 | * @return Payment |
||
309 | */ |
||
310 | 15 | public function setRuleMin($ruleMin = null) |
|
311 | { |
||
312 | 15 | $this->rule_min = $ruleMin; |
|
313 | |||
314 | 15 | return $this; |
|
315 | } |
||
316 | |||
317 | /** |
||
318 | * Get ruleMin. |
||
319 | * |
||
320 | * @return string|null |
||
321 | */ |
||
322 | 17 | public function getRuleMin() |
|
323 | { |
||
324 | 17 | return $this->rule_min; |
|
325 | } |
||
326 | |||
327 | /** |
||
328 | * Set methodClass. |
||
329 | * |
||
330 | * @param string|null $methodClass |
||
331 | * |
||
332 | * @return Payment |
||
333 | */ |
||
334 | 1 | public function setMethodClass($methodClass = null) |
|
335 | { |
||
336 | 1 | $this->method_class = $methodClass; |
|
337 | |||
338 | 1 | return $this; |
|
339 | } |
||
340 | |||
341 | /** |
||
342 | * Get methodClass. |
||
343 | * |
||
344 | * @return string|null |
||
345 | */ |
||
346 | 8 | public function getMethodClass() |
|
347 | { |
||
348 | 8 | return $this->method_class; |
|
349 | } |
||
350 | |||
351 | /** |
||
352 | * @return integer |
||
353 | */ |
||
354 | 18 | public function isVisible() |
|
355 | { |
||
356 | 18 | return $this->visible; |
|
357 | } |
||
358 | |||
359 | /** |
||
360 | * @param boolean $visible |
||
361 | * |
||
362 | * @return Payment |
||
363 | */ |
||
364 | 14 | public function setVisible($visible) |
|
365 | { |
||
366 | 14 | $this->visible = $visible; |
|
0 ignored issues
–
show
|
|||
367 | |||
368 | 14 | return $this; |
|
369 | } |
||
370 | |||
371 | /** |
||
372 | * Set createDate. |
||
373 | * |
||
374 | * @param \DateTime $createDate |
||
375 | * |
||
376 | * @return Payment |
||
377 | */ |
||
378 | 12 | public function setCreateDate($createDate) |
|
379 | { |
||
380 | 12 | $this->create_date = $createDate; |
|
381 | |||
382 | 12 | return $this; |
|
383 | } |
||
384 | |||
385 | /** |
||
386 | * Get createDate. |
||
387 | * |
||
388 | * @return \DateTime |
||
389 | */ |
||
390 | public function getCreateDate() |
||
391 | { |
||
392 | return $this->create_date; |
||
393 | } |
||
394 | |||
395 | /** |
||
396 | * Set updateDate. |
||
397 | * |
||
398 | * @param \DateTime $updateDate |
||
399 | * |
||
400 | * @return Payment |
||
401 | */ |
||
402 | 16 | public function setUpdateDate($updateDate) |
|
403 | { |
||
404 | 16 | $this->update_date = $updateDate; |
|
405 | |||
406 | 16 | return $this; |
|
407 | } |
||
408 | |||
409 | /** |
||
410 | * Get updateDate. |
||
411 | * |
||
412 | * @return \DateTime |
||
413 | */ |
||
414 | public function getUpdateDate() |
||
415 | { |
||
416 | return $this->update_date; |
||
417 | } |
||
418 | |||
419 | /** |
||
420 | * Add paymentOption. |
||
421 | * |
||
422 | * @param \Eccube\Entity\PaymentOption $paymentOption |
||
423 | * |
||
424 | * @return Payment |
||
425 | */ |
||
426 | 159 | public function addPaymentOption(\Eccube\Entity\PaymentOption $paymentOption) |
|
427 | { |
||
428 | 159 | $this->PaymentOptions[] = $paymentOption; |
|
429 | |||
430 | 159 | return $this; |
|
431 | } |
||
432 | |||
433 | /** |
||
434 | * Remove paymentOption. |
||
435 | * |
||
436 | * @param \Eccube\Entity\PaymentOption $paymentOption |
||
437 | * |
||
438 | * @return boolean TRUE if this collection contained the specified element, FALSE otherwise. |
||
439 | */ |
||
440 | public function removePaymentOption(\Eccube\Entity\PaymentOption $paymentOption) |
||
441 | { |
||
442 | return $this->PaymentOptions->removeElement($paymentOption); |
||
443 | } |
||
444 | |||
445 | /** |
||
446 | * Get paymentOptions. |
||
447 | * |
||
448 | * @return \Doctrine\Common\Collections\Collection |
||
449 | */ |
||
450 | public function getPaymentOptions() |
||
451 | { |
||
452 | return $this->PaymentOptions; |
||
453 | } |
||
454 | |||
455 | /** |
||
456 | * Set creator. |
||
457 | * |
||
458 | * @param \Eccube\Entity\Member|null $creator |
||
459 | * |
||
460 | * @return Payment |
||
461 | */ |
||
462 | 6 | public function setCreator(\Eccube\Entity\Member $creator = null) |
|
463 | { |
||
464 | 6 | $this->Creator = $creator; |
|
465 | |||
466 | 6 | return $this; |
|
467 | } |
||
468 | |||
469 | /** |
||
470 | * Get creator. |
||
471 | * |
||
472 | * @return \Eccube\Entity\Member|null |
||
473 | */ |
||
474 | public function getCreator() |
||
475 | { |
||
476 | return $this->Creator; |
||
477 | } |
||
478 | } |
||
479 | } |
||
480 |
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.