Complex classes like Invoice often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes. You can also have a look at the cohesion graph to spot any un-connected, or weakly-connected components.
Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.
While breaking up the class, it is a good idea to analyze how other classes use Invoice, and based on these observations, apply Extract Interface, too.
1 | <?php |
||
10 | class Invoice |
||
11 | { |
||
12 | const INVOICE_TYPE_OUTGOING = 'outgoing'; |
||
13 | const INVOICE_TYPE_DRAFT = 'draft'; |
||
14 | const INVOICE_TYPE_CREDIT = 'credit'; |
||
15 | |||
16 | const INVOICE_SALUTATION_NONE = ''; |
||
17 | const INVOICE_SALUTATION_MR = 'mr'; |
||
18 | const INVOICE_SALUTATION_MRS = 'mrs'; |
||
19 | const INVOICE_SALUTATION_FAMILY = 'family'; |
||
20 | |||
21 | const INVOICE_PAYMENT_TYPE_TRANSFER = 1; |
||
22 | const INVOICE_PAYMENT_TYPE_DIRECT_DEBIT = 2; |
||
23 | const INVOICE_PAYMENT_TYPE_CASH = 3; |
||
24 | const INVOICE_PAYMENT_TYPE_PAYPAL = 4; |
||
25 | const INVOICE_PAYMENT_TYPE_ADVANCED_PAYMENT = 5; |
||
26 | const INVOICE_PAYMENT_TYPE_CREDIT_CARD = 6; |
||
27 | |||
28 | const INVOICE_STATUS_OVERDUE = 'overdue'; |
||
29 | const INVOICE_STATUS_PAID = 'paid'; |
||
30 | const INVOICE_STATUS_UNPAID = 'unpaid'; |
||
31 | |||
32 | /** |
||
33 | * The invoice id. |
||
34 | * |
||
35 | * @var integer |
||
36 | * |
||
37 | * @JMS\Type("integer") |
||
38 | * @JMS\SerializedName("INVOICE_ID") |
||
39 | */ |
||
40 | protected $invoiceId; |
||
41 | |||
42 | /** |
||
43 | * The invoice external id. |
||
44 | * |
||
45 | * @var string |
||
46 | * |
||
47 | * @JMS\Type("string") |
||
48 | * @JMS\SerializedName("INVOICE_EXT_UID") |
||
49 | */ |
||
50 | protected $invoiceExternalId; |
||
51 | |||
52 | /** |
||
53 | * The status. |
||
54 | * |
||
55 | * @var string |
||
56 | * |
||
57 | * @JMS\Type("string") |
||
58 | * @JMS\SerializedName("STATUS") |
||
59 | */ |
||
60 | protected $status; |
||
61 | |||
62 | /** |
||
63 | * The type. |
||
64 | * |
||
65 | * @var string |
||
66 | * |
||
67 | * @JMS\Type("string") |
||
68 | * @JMS\SerializedName("TYPE") |
||
69 | */ |
||
70 | protected $type; |
||
71 | |||
72 | /** |
||
73 | * The customer ID. |
||
74 | * |
||
75 | * @var integer |
||
76 | * |
||
77 | * @JMS\Type("integer") |
||
78 | * @JMS\SerializedName("CUSTOMER_ID") |
||
79 | */ |
||
80 | protected $customerId; |
||
81 | |||
82 | /** |
||
83 | * The own customer number. |
||
84 | * |
||
85 | * @var string |
||
86 | * |
||
87 | * @JMS\Type("string") |
||
88 | * @JMS\SerializedName("CUSTOMER_NUMBER") |
||
89 | */ |
||
90 | protected $customerNumber; |
||
91 | |||
92 | /** |
||
93 | * The customer cost center ID. |
||
94 | * |
||
95 | * @var integer |
||
96 | * |
||
97 | * @JMS\Type("integer") |
||
98 | * @JMS\SerializedName("CUSTOMER_COSTCENTER_ID") |
||
99 | */ |
||
100 | protected $customerCostCenterId; |
||
101 | |||
102 | /** |
||
103 | * The name of the organization. |
||
104 | * |
||
105 | * @var string |
||
106 | * |
||
107 | * @JMS\Type("string") |
||
108 | * @JMS\SerializedName("ORGANIZATION") |
||
109 | */ |
||
110 | protected $organization; |
||
111 | |||
112 | /** |
||
113 | * Salutation. |
||
114 | * |
||
115 | * @var string |
||
116 | * |
||
117 | * @JMS\Type("string") |
||
118 | * @JMS\SerializedName("SALUTATION") |
||
119 | */ |
||
120 | protected $salutation; |
||
121 | |||
122 | /** |
||
123 | * The first name. |
||
124 | * |
||
125 | * @var string |
||
126 | * |
||
127 | * @JMS\Type("string") |
||
128 | * @JMS\SerializedName("FIRST_NAME") |
||
129 | */ |
||
130 | protected $firstName; |
||
131 | |||
132 | /** |
||
133 | * The last name. |
||
134 | * |
||
135 | * @var string |
||
136 | * |
||
137 | * @JMS\Type("string") |
||
138 | * @JMS\SerializedName("LAST_NAME") |
||
139 | */ |
||
140 | protected $lastName; |
||
141 | |||
142 | /** |
||
143 | * The address. |
||
144 | * |
||
145 | * @var string |
||
146 | * |
||
147 | * @JMS\Type("string") |
||
148 | * @JMS\SerializedName("ADDRESS") |
||
149 | */ |
||
150 | protected $address; |
||
151 | |||
152 | /** |
||
153 | * The address2. |
||
154 | * |
||
155 | * @var string |
||
156 | * |
||
157 | * @JMS\Type("string") |
||
158 | * @JMS\SerializedName("ADDRESS_2") |
||
159 | */ |
||
160 | protected $address2; |
||
161 | |||
162 | /** |
||
163 | * The zip code. |
||
164 | * |
||
165 | * @var string |
||
166 | * |
||
167 | * @JMS\Type("string") |
||
168 | * @JMS\SerializedName("ZIPCODE") |
||
169 | */ |
||
170 | protected $zipCode; |
||
171 | |||
172 | /** |
||
173 | * The city. |
||
174 | * |
||
175 | * @var string |
||
176 | * |
||
177 | * @JMS\Type("string") |
||
178 | * @JMS\SerializedName("CITY") |
||
179 | */ |
||
180 | protected $city; |
||
181 | |||
182 | /** |
||
183 | * Some comments about the invoice. |
||
184 | * |
||
185 | * @var string |
||
186 | * |
||
187 | * @JMS\Type("string") |
||
188 | * @JMS\SerializedName("COMMENT") |
||
189 | */ |
||
190 | protected $comment; |
||
191 | |||
192 | /** |
||
193 | * Payment type. |
||
194 | * |
||
195 | * @var integer |
||
196 | * |
||
197 | * @JMS\Type("integer") |
||
198 | * @JMS\SerializedName("PAYMENT_TYPE") |
||
199 | */ |
||
200 | protected $paymentType; |
||
201 | |||
202 | /** |
||
203 | * Days until date of payment. |
||
204 | * |
||
205 | * @var integer |
||
206 | * |
||
207 | * @JMS\Type("integer") |
||
208 | * @JMS\SerializedName("DAYS_FOR_PAYMENT") |
||
209 | */ |
||
210 | protected $paymentDays; |
||
211 | |||
212 | /** |
||
213 | * The bank name. |
||
214 | * |
||
215 | * @var string |
||
216 | * |
||
217 | * @JMS\Type("string") |
||
218 | * @JMS\SerializedName("BANK_NAME") |
||
219 | */ |
||
220 | protected $bankName; |
||
221 | |||
222 | /** |
||
223 | * The bank account number. |
||
224 | * |
||
225 | * @var string |
||
226 | * |
||
227 | * @JMS\Type("string") |
||
228 | * @JMS\SerializedName("BANK_ACCOUNT_NUMBER") |
||
229 | */ |
||
230 | protected $bankAccountNumber; |
||
231 | |||
232 | /** |
||
233 | * The bank code. |
||
234 | * |
||
235 | * @var string |
||
236 | * |
||
237 | * @JMS\Type("string") |
||
238 | * @JMS\SerializedName("BANK_CODE") |
||
239 | */ |
||
240 | protected $bankCode; |
||
241 | |||
242 | /** |
||
243 | * The bank account owner. |
||
244 | * |
||
245 | * @var string |
||
246 | * |
||
247 | * @JMS\Type("string") |
||
248 | * @JMS\SerializedName("BANK_ACCOUNT_OWNER") |
||
249 | */ |
||
250 | protected $bankAccountOwner; |
||
251 | |||
252 | /** |
||
253 | * The bank IBAN. |
||
254 | * |
||
255 | * @var string |
||
256 | * |
||
257 | * @JMS\Type("string") |
||
258 | * @JMS\SerializedName("BANK_IBAN") |
||
259 | */ |
||
260 | protected $bankIBAN; |
||
261 | |||
262 | /** |
||
263 | * The bank BIC. |
||
264 | * |
||
265 | * @var string |
||
266 | * |
||
267 | * @JMS\Type("string") |
||
268 | * @JMS\SerializedName("BANK_BIC") |
||
269 | */ |
||
270 | protected $bankBIC; |
||
271 | |||
272 | /** |
||
273 | * The invoice affiliate. |
||
274 | * |
||
275 | * @var string |
||
276 | * |
||
277 | * @JMS\Type("string") |
||
278 | * @JMS\SerializedName("AFFILIATE") |
||
279 | */ |
||
280 | protected $affiliate; |
||
281 | |||
282 | /** |
||
283 | * The invoice country code (ISO 3166 ALPHA-2). |
||
284 | * |
||
285 | * @var string |
||
286 | * |
||
287 | * @JMS\Type("string") |
||
288 | * @JMS\SerializedName("COUNTRY_CODE") |
||
289 | */ |
||
290 | protected $countryCode; |
||
291 | |||
292 | /** |
||
293 | * The VAT identification number of the invoice. |
||
294 | * |
||
295 | * @var string |
||
296 | * |
||
297 | * @JMS\Type("string") |
||
298 | * @JMS\SerializedName("VAT_ID") |
||
299 | */ |
||
300 | protected $vatId; |
||
301 | |||
302 | /** |
||
303 | * The currency code of the invoice. |
||
304 | * |
||
305 | * @var string |
||
306 | * |
||
307 | * @JMS\Type("string") |
||
308 | * @JMS\SerializedName("CURRENCY_CODE") |
||
309 | */ |
||
310 | protected $currencyCode; |
||
311 | |||
312 | /** |
||
313 | * The template id. |
||
314 | * |
||
315 | * @var integer |
||
316 | * |
||
317 | * @JMS\Type("integer") |
||
318 | * @JMS\SerializedName("TEMPLATE_ID") |
||
319 | */ |
||
320 | protected $templateId; |
||
321 | |||
322 | /** |
||
323 | * The subscription id. |
||
324 | * |
||
325 | * @var integer |
||
326 | * |
||
327 | * @JMS\Type("integer") |
||
328 | * @JMS\SerializedName("SUBSCRIPTION_ID") |
||
329 | */ |
||
330 | protected $subscriptionId; |
||
331 | |||
332 | /** |
||
333 | * The subscription invoice counter. |
||
334 | * |
||
335 | * @var integer |
||
336 | * |
||
337 | * @JMS\Type("integer") |
||
338 | * @JMS\SerializedName("SUBSCRIPTION_INVOICE_COUNTER") |
||
339 | */ |
||
340 | protected $subscriptionInvoiceCounter; |
||
341 | |||
342 | /** |
||
343 | * The invoice number. |
||
344 | * |
||
345 | * @var string |
||
346 | * |
||
347 | * @JMS\Type("string") |
||
348 | * @JMS\SerializedName("INVOICE_NUMBER") |
||
349 | */ |
||
350 | protected $invoiceNumber; |
||
351 | |||
352 | /** |
||
353 | * The invoice title. |
||
354 | * |
||
355 | * @var string |
||
356 | * |
||
357 | * @JMS\Type("string") |
||
358 | * @JMS\SerializedName("INVOICE_TITLE") |
||
359 | */ |
||
360 | protected $invoiceTitle; |
||
361 | |||
362 | /** |
||
363 | * The intro text. |
||
364 | * |
||
365 | * @var string |
||
366 | * |
||
367 | * @JMS\Type("string") |
||
368 | * @JMS\SerializedName("INTROTEXT") |
||
369 | */ |
||
370 | protected $introText; |
||
371 | |||
372 | /** |
||
373 | * The date of received payment. |
||
374 | * |
||
375 | * @var \DateTime |
||
376 | * |
||
377 | * @JMS\Type("DateTime<'Y-m-d H:i:s'>") |
||
378 | * @JMS\SerializedName("PAID_DATE") |
||
379 | */ |
||
380 | protected $paidDate; |
||
381 | |||
382 | /** |
||
383 | * The outstanding amount. |
||
384 | * |
||
385 | * @var string |
||
386 | * |
||
387 | * @JMS\Type("string") |
||
388 | * @JMS\SerializedName("OUTSTANDING_AMOUNT") |
||
389 | */ |
||
390 | protected $outstandingAmount; |
||
391 | |||
392 | /** |
||
393 | * The Flag for canceled status: 0 = no | 1 = yes. |
||
394 | * |
||
395 | * @var integer |
||
396 | * |
||
397 | * @JMS\Type("integer") |
||
398 | * @JMS\SerializedName("IS_CANCELED") |
||
399 | */ |
||
400 | protected $isCanceled; |
||
401 | |||
402 | /** |
||
403 | * The invoice date. |
||
404 | * |
||
405 | * @var \DateTime |
||
406 | * |
||
407 | * @JMS\Type("DateTime<'Y-m-d'>") |
||
408 | * @JMS\SerializedName("INVOICE_DATE") |
||
409 | */ |
||
410 | protected $invoiceDate; |
||
411 | |||
412 | /** |
||
413 | * The due date. |
||
414 | * |
||
415 | * We serialize it as string because of inconsistencies in the Fastbill API response. |
||
416 | * Depending on the customer, the due date may or may not have a time component in the response. |
||
417 | * |
||
418 | * @var \DateTime |
||
419 | * |
||
420 | * @JMS\Type("string") |
||
421 | * @JMS\SerializedName("DUE_DATE") |
||
422 | */ |
||
423 | protected $dueDate; |
||
424 | |||
425 | /** |
||
426 | * The delivery date. |
||
427 | * |
||
428 | * @var string |
||
429 | * |
||
430 | * @JMS\Type("string") |
||
431 | * @JMS\SerializedName("DELIVERY_DATE") |
||
432 | */ |
||
433 | protected $deliveryDate; |
||
434 | |||
435 | /** |
||
436 | * The cash discount percent. |
||
437 | * |
||
438 | * @var string |
||
439 | * |
||
440 | * @JMS\Type("string") |
||
441 | * @JMS\SerializedName("CASH_DISCOUNT_PERCENT") |
||
442 | */ |
||
443 | protected $cashDiscountPercent; |
||
444 | |||
445 | /** |
||
446 | * The cash discount days. |
||
447 | * |
||
448 | * @var string |
||
449 | * |
||
450 | * @JMS\Type("string") |
||
451 | * @JMS\SerializedName("CASH_DISCOUNT_DAYS") |
||
452 | */ |
||
453 | protected $cashDiscountDays; |
||
454 | |||
455 | /** |
||
456 | * The cash discount percent. |
||
457 | * |
||
458 | * @var float |
||
459 | * |
||
460 | * @JMS\Type("float") |
||
461 | * @JMS\SerializedName("SUB_TOTAL") |
||
462 | */ |
||
463 | protected $subTotal; |
||
464 | |||
465 | /** |
||
466 | * The cash discount percent. |
||
467 | * |
||
468 | * @var float |
||
469 | * |
||
470 | * @JMS\Type("float") |
||
471 | * @JMS\SerializedName("VAT_TOTAL") |
||
472 | */ |
||
473 | protected $vatTotal; |
||
474 | |||
475 | /** |
||
476 | * List of all articles for one entity. |
||
477 | * |
||
478 | * @var array |
||
479 | * |
||
480 | * @JMS\Type("array<Speicher210\Fastbill\Api\Model\InvoiceVatItem>") |
||
481 | * @JMS\SerializedName("VAT_ITEMS") |
||
482 | */ |
||
483 | protected $vatItems = array(); |
||
484 | |||
485 | /** |
||
486 | * List of the items |
||
487 | * |
||
488 | * @var array |
||
489 | * |
||
490 | * @JMS\Type("array<Speicher210\Fastbill\Api\Model\InvoiceItem>") |
||
491 | * @JMS\SerializedName("ITEMS") |
||
492 | */ |
||
493 | protected $items = array(); |
||
494 | |||
495 | /** |
||
496 | * The total. |
||
497 | * |
||
498 | * @var float |
||
499 | * |
||
500 | * @JMS\Type("float") |
||
501 | * @JMS\SerializedName("TOTAL") |
||
502 | */ |
||
503 | protected $total; |
||
504 | |||
505 | /** |
||
506 | * The payment info. |
||
507 | * |
||
508 | * @var string |
||
509 | * |
||
510 | * @JMS\Type("string") |
||
511 | * @JMS\SerializedName("PAYMENT_INFO") |
||
512 | */ |
||
513 | protected $paymentInfo; |
||
514 | |||
515 | /** |
||
516 | * The document url. |
||
517 | * |
||
518 | * @var string |
||
519 | * |
||
520 | * @JMS\Type("string") |
||
521 | * @JMS\SerializedName("DOCUMENT_URL") |
||
522 | */ |
||
523 | protected $documentUrl; |
||
524 | |||
525 | /** |
||
526 | * List of shipment-events belonging to the invoice. |
||
527 | * |
||
528 | * @var array |
||
529 | * |
||
530 | * @JMS\Type("array") |
||
531 | * @JMS\SerializedName("SHIPMENTS") |
||
532 | */ |
||
533 | protected $shipments = array(); |
||
534 | |||
535 | /** |
||
536 | * The PayPal url. |
||
537 | * |
||
538 | * @var string |
||
539 | * |
||
540 | * @JMS\Type("string") |
||
541 | * @JMS\SerializedName("PAYPAL_URL") |
||
542 | */ |
||
543 | protected $payPalUrl; |
||
544 | |||
545 | /** |
||
546 | * Get the invoice ID. |
||
547 | * |
||
548 | * @return int |
||
549 | */ |
||
550 | public function getInvoiceId() |
||
554 | |||
555 | /** |
||
556 | * Set the invoice ID. |
||
557 | * |
||
558 | * @param int $invoiceId |
||
559 | * @return Invoice |
||
560 | */ |
||
561 | 6 | public function setInvoiceId($invoiceId) |
|
567 | |||
568 | /** |
||
569 | * Get the invoice external ID. |
||
570 | * |
||
571 | * @return string |
||
572 | */ |
||
573 | public function getInvoiceExternalId() |
||
577 | |||
578 | /** |
||
579 | * Set the invoice external ID. |
||
580 | * |
||
581 | * @param string $invoiceExternalId |
||
582 | * @return Invoice |
||
583 | */ |
||
584 | 6 | public function setInvoiceExternalId($invoiceExternalId) |
|
590 | |||
591 | /** |
||
592 | * Get the status. |
||
593 | * |
||
594 | * @return string |
||
595 | */ |
||
596 | public function getStatus() |
||
600 | |||
601 | /** |
||
602 | * Set the status. |
||
603 | * |
||
604 | * @param string $status |
||
605 | * @return Invoice |
||
606 | */ |
||
607 | 6 | public function setStatus($status) |
|
613 | |||
614 | /** |
||
615 | * Get the type of the invoice. |
||
616 | * |
||
617 | * @return string |
||
618 | */ |
||
619 | public function getType() |
||
623 | |||
624 | /** |
||
625 | * Set the type of the invoice. |
||
626 | * |
||
627 | * @param string $type |
||
628 | * @return Invoice |
||
629 | */ |
||
630 | 6 | public function setType($type) |
|
636 | |||
637 | /** |
||
638 | * Get the customer ID. |
||
639 | * |
||
640 | * @return int |
||
641 | */ |
||
642 | public function getCustomerId() |
||
646 | |||
647 | /** |
||
648 | * Set the customer ID. |
||
649 | * |
||
650 | * @param int $customerId |
||
651 | * @return Invoice |
||
652 | */ |
||
653 | 6 | public function setCustomerId($customerId) |
|
659 | |||
660 | /** |
||
661 | * Get the customer number. |
||
662 | * |
||
663 | * @return int |
||
664 | */ |
||
665 | public function getCustomerNumber() |
||
669 | |||
670 | /** |
||
671 | * Set the customer number. |
||
672 | * |
||
673 | * @param int $customerNumber |
||
674 | * @return Invoice |
||
675 | */ |
||
676 | 6 | public function setCustomerNumber($customerNumber) |
|
682 | |||
683 | /** |
||
684 | * Get the customer cost center ID. |
||
685 | * |
||
686 | * @return int |
||
687 | */ |
||
688 | public function getCustomerCostCenterId() |
||
692 | |||
693 | /** |
||
694 | * Set the customer cost center ID. |
||
695 | * |
||
696 | * @param int $customerCostCenterId |
||
697 | * @return Invoice |
||
698 | */ |
||
699 | 6 | public function setCustomerCostCenterId($customerCostCenterId) |
|
705 | |||
706 | /** |
||
707 | * Get the organization. |
||
708 | * |
||
709 | * @return string |
||
710 | */ |
||
711 | public function getOrganization() |
||
715 | |||
716 | /** |
||
717 | * Set the organization. |
||
718 | * |
||
719 | * @param string $organization |
||
720 | * @return Invoice |
||
721 | */ |
||
722 | 6 | public function setOrganization($organization) |
|
728 | |||
729 | /** |
||
730 | * Get the salutation. |
||
731 | * |
||
732 | * @return string |
||
733 | */ |
||
734 | public function getSalutation() |
||
738 | |||
739 | /** |
||
740 | * Set the salutation. |
||
741 | * |
||
742 | * @param string $salutation |
||
743 | * @return Invoice |
||
744 | */ |
||
745 | 6 | public function setSalutation($salutation) |
|
751 | |||
752 | /** |
||
753 | * Set the first name. |
||
754 | * |
||
755 | * @param string $firstName The name. |
||
756 | * @return Invoice |
||
757 | */ |
||
758 | 6 | public function setFirstName($firstName) |
|
764 | |||
765 | /** |
||
766 | * Get the last name. |
||
767 | * |
||
768 | * @return string |
||
769 | */ |
||
770 | public function getLastName() |
||
774 | |||
775 | /** |
||
776 | * Set the last name. |
||
777 | * |
||
778 | * @param string $lastName The last name. |
||
779 | * @return Invoice |
||
780 | */ |
||
781 | 6 | public function setLastName($lastName) |
|
787 | |||
788 | /** |
||
789 | * Get the address. |
||
790 | * |
||
791 | * @return string |
||
792 | */ |
||
793 | public function getAddress() |
||
797 | |||
798 | /** |
||
799 | * Set the address. |
||
800 | * |
||
801 | * @param string $address The address. |
||
802 | * @return Invoice |
||
803 | */ |
||
804 | 6 | public function setAddress($address) |
|
810 | |||
811 | /** |
||
812 | * Get the address 2. |
||
813 | * |
||
814 | * @return string |
||
815 | */ |
||
816 | public function getAddress2() |
||
820 | |||
821 | /** |
||
822 | * Set the address 2. |
||
823 | * |
||
824 | * @param string $address2 The address. |
||
825 | * @return Invoice |
||
826 | */ |
||
827 | 6 | public function setAddress2($address2) |
|
833 | |||
834 | /** |
||
835 | * Get the zip code. |
||
836 | * |
||
837 | * @return string |
||
838 | */ |
||
839 | public function getZipCode() |
||
843 | |||
844 | /** |
||
845 | * Set the zip code. |
||
846 | * |
||
847 | * @param string $zipCode The zip code. |
||
848 | * @return Invoice |
||
849 | */ |
||
850 | 6 | public function setZipCode($zipCode) |
|
856 | |||
857 | /** |
||
858 | * Get the city. |
||
859 | * |
||
860 | * @return string |
||
861 | */ |
||
862 | public function getCity() |
||
866 | |||
867 | /** |
||
868 | * Set the city. |
||
869 | * |
||
870 | * @param string $city The city. |
||
871 | * @return Invoice |
||
872 | */ |
||
873 | 6 | public function setCity($city) |
|
879 | |||
880 | /** |
||
881 | * Get the comment. |
||
882 | * |
||
883 | * @return string |
||
884 | */ |
||
885 | public function getComment() |
||
889 | |||
890 | /** |
||
891 | * Set the comment. |
||
892 | * |
||
893 | * @param string $comment |
||
894 | * @return Invoice |
||
895 | */ |
||
896 | 6 | public function setComment($comment) |
|
902 | |||
903 | /** |
||
904 | * Get the payment type. |
||
905 | * |
||
906 | * @return int |
||
907 | */ |
||
908 | public function getPaymentType() |
||
912 | |||
913 | /** |
||
914 | * Set the payment type. |
||
915 | * |
||
916 | * @param int $paymentType |
||
917 | * @return Invoice |
||
918 | */ |
||
919 | 6 | public function setPaymentType($paymentType) |
|
925 | |||
926 | /** |
||
927 | * Get the payment days. |
||
928 | * |
||
929 | * @return int |
||
930 | */ |
||
931 | public function getPaymentDays() |
||
935 | |||
936 | /** |
||
937 | * Set the payment days. |
||
938 | * |
||
939 | * @param int $paymentDays |
||
940 | * @return Invoice |
||
941 | */ |
||
942 | 6 | public function setPaymentDays($paymentDays) |
|
948 | |||
949 | /** |
||
950 | * Get the bank name. |
||
951 | * |
||
952 | * @return string |
||
953 | */ |
||
954 | public function getBankName() |
||
958 | |||
959 | /** |
||
960 | * Get the bank name. |
||
961 | * |
||
962 | * @param string $bankName The name of the back. |
||
963 | * @return Invoice |
||
964 | */ |
||
965 | public function setBankName($bankName) |
||
971 | |||
972 | /** |
||
973 | * Get the bank account number. |
||
974 | * |
||
975 | * @return string |
||
976 | */ |
||
977 | public function getBankAccountNumber() |
||
981 | |||
982 | /** |
||
983 | * Set the bank account number. |
||
984 | * |
||
985 | * @param string $bankAccountNumber |
||
986 | * @return Invoice |
||
987 | */ |
||
988 | public function setBankAccountNumber($bankAccountNumber) |
||
994 | |||
995 | /** |
||
996 | * Get the bank code. |
||
997 | * |
||
998 | * @return string |
||
999 | */ |
||
1000 | public function getBankCode() |
||
1004 | |||
1005 | /** |
||
1006 | * Set the bank code. |
||
1007 | * |
||
1008 | * @param string $bankCode The code. |
||
1009 | * @return Invoice |
||
1010 | */ |
||
1011 | public function setBankCode($bankCode) |
||
1017 | |||
1018 | /** |
||
1019 | * Get the bank account owner. |
||
1020 | * |
||
1021 | * @return string |
||
1022 | */ |
||
1023 | public function getBankAccountOwner() |
||
1027 | |||
1028 | /** |
||
1029 | * Set the bank account owner. |
||
1030 | * |
||
1031 | * @param string $bankAccountOwner The owner. |
||
1032 | * @return Invoice |
||
1033 | */ |
||
1034 | public function setBankAccountOwner($bankAccountOwner) |
||
1040 | |||
1041 | /** |
||
1042 | * Get the bank IBAN. |
||
1043 | * |
||
1044 | * @return string |
||
1045 | */ |
||
1046 | public function getBankIBAN() |
||
1050 | |||
1051 | /** |
||
1052 | * Set the bank IBAN. |
||
1053 | * |
||
1054 | * @param string $bankIBAN The IBAN code. |
||
1055 | * @return Invoice |
||
1056 | */ |
||
1057 | public function setBankIBAN($bankIBAN) |
||
1063 | |||
1064 | /** |
||
1065 | * Get the bank BIC. |
||
1066 | * |
||
1067 | * @return string |
||
1068 | */ |
||
1069 | public function getBankBIC() |
||
1073 | |||
1074 | /** |
||
1075 | * Set the bank BIC. |
||
1076 | * |
||
1077 | * @param string $bankBIC The BIC. |
||
1078 | * @return Invoice |
||
1079 | */ |
||
1080 | public function setBankBIC($bankBIC) |
||
1086 | |||
1087 | /** |
||
1088 | * Get the affiliate. |
||
1089 | * |
||
1090 | * @return string |
||
1091 | */ |
||
1092 | public function getAffiliate() |
||
1096 | |||
1097 | /** |
||
1098 | * Set the affiliate. |
||
1099 | * |
||
1100 | * @param string $affiliate |
||
1101 | * @return Invoice |
||
1102 | */ |
||
1103 | public function setAffiliate($affiliate) |
||
1109 | |||
1110 | /** |
||
1111 | * Get the country code. |
||
1112 | * |
||
1113 | * @return string |
||
1114 | */ |
||
1115 | public function getCountryCode() |
||
1119 | |||
1120 | /** |
||
1121 | * Set the country code (ISO 3166 ALPHA-2). |
||
1122 | * |
||
1123 | * @param string $countryCode |
||
1124 | * @return Invoice |
||
1125 | */ |
||
1126 | 6 | public function setCountryCode($countryCode) |
|
1132 | |||
1133 | /** |
||
1134 | * Get the vat ID. |
||
1135 | * |
||
1136 | * @return string |
||
1137 | */ |
||
1138 | public function getVatId() |
||
1142 | |||
1143 | /** |
||
1144 | * Set the vat ID. |
||
1145 | * |
||
1146 | * @param string $vatId |
||
1147 | * @return Invoice |
||
1148 | */ |
||
1149 | 6 | public function setVatId($vatId) |
|
1155 | |||
1156 | /** |
||
1157 | * Get the currency code. |
||
1158 | * |
||
1159 | * @return string |
||
1160 | */ |
||
1161 | public function getCurrencyCode() |
||
1165 | |||
1166 | /** |
||
1167 | * Set the currency code. |
||
1168 | * |
||
1169 | * @param string $currencyCode |
||
1170 | * @return Invoice |
||
1171 | */ |
||
1172 | 6 | public function setCurrencyCode($currencyCode) |
|
1178 | |||
1179 | /** |
||
1180 | * Get the template ID. |
||
1181 | * |
||
1182 | * @return int |
||
1183 | */ |
||
1184 | public function getTemplateId() |
||
1188 | |||
1189 | /** |
||
1190 | * Set the template ID. |
||
1191 | * |
||
1192 | * @param int $templateId |
||
1193 | * @return Invoice |
||
1194 | */ |
||
1195 | 6 | public function setTemplateId($templateId) |
|
1201 | |||
1202 | /** |
||
1203 | * Get the subscription ID. |
||
1204 | * |
||
1205 | * @return int |
||
1206 | */ |
||
1207 | public function getSubscriptionId() |
||
1211 | |||
1212 | /** |
||
1213 | * Set the subscription ID. |
||
1214 | * |
||
1215 | * @param int $subscriptionId |
||
1216 | * @return Invoice |
||
1217 | */ |
||
1218 | 6 | public function setSubscriptionId($subscriptionId) |
|
1224 | |||
1225 | /** |
||
1226 | * Get the invoice number. |
||
1227 | * |
||
1228 | * @return string |
||
1229 | */ |
||
1230 | public function getInvoiceNumber() |
||
1234 | |||
1235 | /** |
||
1236 | * Set the invoice number. |
||
1237 | * |
||
1238 | * @param string $invoiceNumber |
||
1239 | * @return Invoice |
||
1240 | */ |
||
1241 | 6 | public function setInvoiceNumber($invoiceNumber) |
|
1247 | |||
1248 | /** |
||
1249 | * Get the invoice title. |
||
1250 | * |
||
1251 | * @return string |
||
1252 | */ |
||
1253 | public function getInvoiceTitle() |
||
1257 | |||
1258 | /** |
||
1259 | * Set the invoice title. |
||
1260 | * |
||
1261 | * @param string $invoiceTitle |
||
1262 | * @return Invoice |
||
1263 | */ |
||
1264 | 6 | public function setInvoiceTitle($invoiceTitle) |
|
1270 | |||
1271 | /** |
||
1272 | * Get the intro text. |
||
1273 | * |
||
1274 | * @return string |
||
1275 | */ |
||
1276 | public function getIntroText() |
||
1280 | |||
1281 | /** |
||
1282 | * Set the intro text. |
||
1283 | * |
||
1284 | * @param string $introText |
||
1285 | * @return Invoice |
||
1286 | */ |
||
1287 | 6 | public function setIntroText($introText) |
|
1293 | |||
1294 | /** |
||
1295 | * Get paid date. |
||
1296 | * |
||
1297 | * @return \DateTime |
||
1298 | */ |
||
1299 | public function getPaidDate() |
||
1303 | |||
1304 | /** |
||
1305 | * Set paid date. |
||
1306 | * |
||
1307 | * @param \DateTime $paidDate |
||
1308 | * @return Invoice |
||
1309 | */ |
||
1310 | 6 | public function setPaidDate($paidDate) |
|
1316 | |||
1317 | /** |
||
1318 | * Get if the invoice is canceled. |
||
1319 | * |
||
1320 | * @return int |
||
1321 | */ |
||
1322 | public function getIsCanceled() |
||
1326 | |||
1327 | /** |
||
1328 | * Set if the invoice is canceled. |
||
1329 | * |
||
1330 | * @param int $isCanceled |
||
1331 | * @return Invoice |
||
1332 | */ |
||
1333 | 6 | public function setIsCanceled($isCanceled) |
|
1339 | |||
1340 | /** |
||
1341 | * Get the invoice date. |
||
1342 | * |
||
1343 | * @return \DateTime |
||
1344 | */ |
||
1345 | 6 | public function getInvoiceDate() |
|
1349 | |||
1350 | /** |
||
1351 | * Set the invoice date. |
||
1352 | * |
||
1353 | * @param \DateTime $invoiceDate |
||
1354 | * @return Invoice |
||
1355 | */ |
||
1356 | 6 | public function setInvoiceDate($invoiceDate) |
|
1362 | |||
1363 | /** |
||
1364 | * Get the due date. |
||
1365 | * |
||
1366 | * @return \DateTime |
||
1367 | */ |
||
1368 | 6 | public function getDueDate() |
|
1372 | |||
1373 | /** |
||
1374 | * Set the due date. |
||
1375 | * |
||
1376 | * @param \DateTime $dueDate |
||
1377 | * @return Invoice |
||
1378 | */ |
||
1379 | 6 | public function setDueDate($dueDate) |
|
1385 | |||
1386 | /** |
||
1387 | * Get delivery date. |
||
1388 | * |
||
1389 | * @return string |
||
1390 | */ |
||
1391 | public function getDeliveryDate() |
||
1395 | |||
1396 | /** |
||
1397 | * Set the delivery date. |
||
1398 | * |
||
1399 | * @param string $deliveryDate |
||
1400 | * @return Invoice |
||
1401 | */ |
||
1402 | 6 | public function setDeliveryDate($deliveryDate) |
|
1408 | |||
1409 | /** |
||
1410 | * Get the cash discount percent. |
||
1411 | * |
||
1412 | * @return string |
||
1413 | */ |
||
1414 | public function getCashDiscountPercent() |
||
1418 | |||
1419 | /** |
||
1420 | * Set the cash discount percent. |
||
1421 | * |
||
1422 | * @param string $cashDiscountPercent |
||
1423 | * @return Invoice |
||
1424 | */ |
||
1425 | 6 | public function setCashDiscountPercent($cashDiscountPercent) |
|
1431 | |||
1432 | /** |
||
1433 | * Get the cash discount days. |
||
1434 | * |
||
1435 | * @return string |
||
1436 | */ |
||
1437 | public function getCashDiscountDays() |
||
1441 | |||
1442 | /** |
||
1443 | * Set the cash discount days. |
||
1444 | * |
||
1445 | * @param string $cashDiscountDays |
||
1446 | * @return Invoice |
||
1447 | */ |
||
1448 | 6 | public function setCashDiscountDays($cashDiscountDays) |
|
1454 | |||
1455 | /** |
||
1456 | * Get the sub total. |
||
1457 | * |
||
1458 | * @return float |
||
1459 | */ |
||
1460 | public function getSubTotal() |
||
1464 | |||
1465 | /** |
||
1466 | * Set the sub total. |
||
1467 | * |
||
1468 | * @param float $subTotal |
||
1469 | * @return Invoice |
||
1470 | */ |
||
1471 | 6 | public function setSubTotal($subTotal) |
|
1477 | |||
1478 | /** |
||
1479 | * Get the vat total. |
||
1480 | * |
||
1481 | * @return float |
||
1482 | */ |
||
1483 | public function getVatTotal() |
||
1487 | |||
1488 | /** |
||
1489 | * Set the vat total. |
||
1490 | * |
||
1491 | * @param float $vatTotal |
||
1492 | * @return Invoice |
||
1493 | */ |
||
1494 | 6 | public function setVatTotal($vatTotal) |
|
1500 | |||
1501 | /** |
||
1502 | * Get the vat items. |
||
1503 | * |
||
1504 | * @return array |
||
1505 | */ |
||
1506 | public function getVatItems() |
||
1510 | |||
1511 | /** |
||
1512 | * Set the vat items. |
||
1513 | * |
||
1514 | * @param InvoiceVatItem[] $vatItems |
||
1515 | * @return Invoice |
||
1516 | */ |
||
1517 | public function setVatItems(array $vatItems) |
||
1523 | |||
1524 | /** |
||
1525 | * Add a vat item. |
||
1526 | * |
||
1527 | * @param InvoiceVatItem $vatItem The vat item to add. |
||
1528 | */ |
||
1529 | 6 | public function addVatItem(InvoiceVatItem $vatItem) |
|
1530 | { |
||
1531 | 6 | $this->vatItems[] = $vatItem; |
|
1532 | 6 | } |
|
1533 | |||
1534 | /** |
||
1535 | * Get the items. |
||
1536 | * |
||
1537 | * @return array |
||
1538 | */ |
||
1539 | public function getItems() |
||
1543 | |||
1544 | /** |
||
1545 | * Set the items. |
||
1546 | * |
||
1547 | * @param InvoiceItem[] $items The items. |
||
1548 | * @return Invoice |
||
1549 | */ |
||
1550 | public function setItems(array $items) |
||
1556 | |||
1557 | /** |
||
1558 | * Add an item. |
||
1559 | * |
||
1560 | * @param InvoiceItem $item The item to add. |
||
1561 | */ |
||
1562 | 6 | public function addItem(InvoiceItem $item) |
|
1563 | { |
||
1564 | 6 | $this->items[] = $item; |
|
1565 | 6 | } |
|
1566 | |||
1567 | /** |
||
1568 | * Get the total. |
||
1569 | * |
||
1570 | * @return float |
||
1571 | */ |
||
1572 | public function getTotal() |
||
1576 | |||
1577 | /** |
||
1578 | * Set the total. |
||
1579 | * |
||
1580 | * @param float $total |
||
1581 | * @return Invoice |
||
1582 | */ |
||
1583 | 6 | public function setTotal($total) |
|
1589 | |||
1590 | /** |
||
1591 | * Get the payment info. |
||
1592 | * |
||
1593 | * @return string |
||
1594 | */ |
||
1595 | public function getPaymentInfo() |
||
1599 | |||
1600 | /** |
||
1601 | * Set the payment info. |
||
1602 | * |
||
1603 | * @param string $paymentInfo |
||
1604 | * @return Invoice |
||
1605 | */ |
||
1606 | 6 | public function setPaymentInfo($paymentInfo) |
|
1612 | |||
1613 | /** |
||
1614 | * Get the document url. |
||
1615 | * |
||
1616 | * @return string |
||
1617 | */ |
||
1618 | public function getDocumentUrl() |
||
1622 | |||
1623 | /** |
||
1624 | * Set the document url. |
||
1625 | * |
||
1626 | * @param string $documentUrl |
||
1627 | * @return Invoice |
||
1628 | */ |
||
1629 | 6 | public function setDocumentUrl($documentUrl) |
|
1635 | |||
1636 | /** |
||
1637 | * Get the shipments. |
||
1638 | * |
||
1639 | * @return array |
||
1640 | */ |
||
1641 | public function getShipments() |
||
1645 | |||
1646 | /** |
||
1647 | * Set the shipments. |
||
1648 | * |
||
1649 | * @param array $shipments |
||
1650 | * @return Invoice |
||
1651 | */ |
||
1652 | public function setShipments(array $shipments) |
||
1658 | |||
1659 | /** |
||
1660 | * Get the PayPal url. |
||
1661 | * |
||
1662 | * @return string |
||
1663 | */ |
||
1664 | public function getPayPalUrl() |
||
1668 | |||
1669 | /** |
||
1670 | * Set the PayPal url. |
||
1671 | * |
||
1672 | * @param string $payPalUrl The PayPal url. |
||
1673 | * @return Invoice |
||
1674 | */ |
||
1675 | 6 | public function setPayPalUrl($payPalUrl) |
|
1681 | |||
1682 | /** |
||
1683 | * Get the subscription invoice counter. |
||
1684 | * |
||
1685 | * @return int |
||
1686 | */ |
||
1687 | public function getSubscriptionInvoiceCounter() |
||
1691 | |||
1692 | /** |
||
1693 | * Set the subscription invoice counter. |
||
1694 | * |
||
1695 | * @param int $subscriptionInvoiceCounter |
||
1696 | * @return Invoice |
||
1697 | */ |
||
1698 | 6 | public function setSubscriptionInvoiceCounter($subscriptionInvoiceCounter) |
|
1704 | |||
1705 | /** |
||
1706 | * Get the outstanding amount. |
||
1707 | * |
||
1708 | * @return string |
||
1709 | */ |
||
1710 | public function getOutstandingAmount() |
||
1714 | |||
1715 | /** |
||
1716 | * Set the outstanding amount. |
||
1717 | * |
||
1718 | * @param string $outstandingAmount |
||
1719 | * @return Invoice |
||
1720 | */ |
||
1721 | 6 | public function setOutstandingAmount($outstandingAmount) |
|
1727 | |||
1728 | /** |
||
1729 | * @JMS\PreSerialize() |
||
1730 | */ |
||
1731 | protected function preSerializer() |
||
1735 | } |
||
1736 |
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.