1 | <?php |
||
2 | |||
3 | /** |
||
4 | * MÓDULO DE EMISIÓN ELECTRÓNICA F72X |
||
5 | * UBL 2.1 |
||
6 | * Version 1.1 |
||
7 | * |
||
8 | * Copyright 2021, Jaime Cruz |
||
9 | */ |
||
10 | |||
11 | namespace F72X\UblComponent; |
||
12 | |||
13 | use Sabre\Xml\Writer; |
||
14 | |||
15 | class PaymentTerms extends BaseComponent |
||
16 | { |
||
17 | |||
18 | protected $ID; |
||
19 | protected $PaymentMeansID; |
||
20 | /** @var Amount */ |
||
21 | protected $Amount; |
||
22 | protected $PaymentDueDate; |
||
23 | public function __construct($ID, $PaymentMeansID) |
||
24 | { |
||
25 | $this->ID = $ID; |
||
26 | $this->PaymentMeansID = $PaymentMeansID; |
||
27 | } |
||
28 | function xmlSerialize(Writer $writer) |
||
0 ignored issues
–
show
|
|||
29 | { |
||
30 | $writer->write([ |
||
31 | SchemaNS::CBC . 'ID' => $this->ID, |
||
32 | SchemaNS::CBC . 'PaymentMeansID' => $this->PaymentMeansID |
||
33 | ]); |
||
34 | if ($this->Amount) { |
||
35 | $writer->write([ |
||
36 | $this->Amount |
||
37 | ]); |
||
38 | } |
||
39 | if ($this->PaymentDueDate) { |
||
40 | $writer->write([ |
||
41 | SchemaNS::CBC . 'PaymentDueDate' => $this->PaymentDueDate->format('Y-m-d') |
||
42 | ]); |
||
43 | } |
||
44 | } |
||
45 | |||
46 | public function setAmount($Amount) |
||
47 | { |
||
48 | $this->Amount = $Amount; |
||
49 | return $this; |
||
50 | } |
||
51 | |||
52 | public function setPaymentDueDate($PaymentDueDate) |
||
53 | { |
||
54 | $this->PaymentDueDate = $PaymentDueDate; |
||
55 | return $this; |
||
56 | } |
||
57 | } |
||
58 |
Adding explicit visibility (
private
,protected
, orpublic
) is generally recommend to communicate to other developers how, and from where this method is intended to be used.