-
Notifications
You must be signed in to change notification settings - Fork 98
Expand file tree
/
Copy pathAccountingParty.php
More file actions
114 lines (98 loc) · 2.77 KB
/
Copy pathAccountingParty.php
File metadata and controls
114 lines (98 loc) · 2.77 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php
namespace NumNum\UBL;
use function Sabre\Xml\Deserializer\keyValue;
use Sabre\Xml\Reader;
use Sabre\Xml\Writer;
use Sabre\Xml\XmlDeserializable;
use Sabre\Xml\XmlSerializable;
class AccountingParty implements XmlSerializable, XmlDeserializable
{
private ?string $supplierAssignedAccountID = null;
private ?Party $party = null;
private ?Contact $accountingContact = null;
/**
* @return string|null
*/
public function getSupplierAssignedAccountId(): ?string
{
return $this->supplierAssignedAccountID;
}
/**
* @param string|null $supplierAssignedAccountID
* @return static
*/
public function setSupplierAssignedAccountId(?string $supplierAssignedAccountID)
{
$this->supplierAssignedAccountID = $supplierAssignedAccountID;
return $this;
}
/**
* @return Party|null
*/
public function getParty(): ?Party
{
return $this->party;
}
/**
* @param Party|null $party
* @return static
*/
public function setParty(?Party $party)
{
$this->party = $party;
return $this;
}
/**
* @return Contact|null
*/
public function getAccountingContact(): ?Contact
{
return $this->accountingContact;
}
/**
* @param Contact|null $accountingContact
* @return AccountingParty
*/
public function setAccountingContact(?Contact $accountingContact): AccountingParty
{
$this->accountingContact = $accountingContact;
return $this;
}
/**
* The xmlSerialize method is called during xml writing.
*
* @param Writer $writer
* @return void
*/
public function xmlSerialize(Writer $writer): void
{
if (!empty($this->supplierAssignedAccountID)) {
$writer->write([
Schema::CBC . 'SupplierAssignedAccountID' => $this->supplierAssignedAccountID,
]);
}
if (!empty($this->party)) {
$writer->write([
Schema::CAC . 'Party' => $this->party,
]);
}
if (!empty($this->accountingContact)) {
$writer->write([
Schema::CAC . 'AccountingContact' => $this->accountingContact,
]);
}
}
/**
* The xmlDeserialize method is called during xml reading.
* @param Reader $reader
* @return static
*/
public static function xmlDeserialize(Reader $reader)
{
$keyValues = keyValue($reader);
return (new static())
->setParty($keyValues[Schema::CAC . 'Party'] ?? null)
->setSupplierAssignedAccountId($keyValues[Schema::CBC . 'SupplierAssignedAccountID'] ?? null)
->setAccountingContact($keyValues[Schema::CBC . 'AccountingContact'] ?? null);
}
}