|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace Genkgo\Camt\Decoder\Factory\DTO; |
|
6
|
|
|
|
|
7
|
|
|
use Genkgo\Camt\DTO; |
|
8
|
|
|
use SimpleXMLElement; |
|
9
|
|
|
|
|
10
|
|
|
class OrganisationIdentification |
|
11
|
|
|
{ |
|
12
|
|
|
use Behavior\Mapping; |
|
13
|
|
|
|
|
14
|
1 |
|
public static function createFromXml(SimpleXMLElement $xmlOrganisationIdentification): DTO\OrganisationIdentification |
|
15
|
|
|
{ |
|
16
|
|
|
$mapping = [ |
|
17
|
1 |
|
['setter' => 'setBic', 'value' => 'BIC'], |
|
18
|
|
|
['setter' => 'setBic', 'value' => 'BICOrBEI'], |
|
19
|
|
|
['setter' => 'setBic', 'value' => 'AnyBIC'], |
|
20
|
|
|
['setter' => 'setBei', 'value' => 'BICOrBEI'], |
|
21
|
|
|
['setter' => 'setIbei', 'value' => 'IBEI'], |
|
22
|
|
|
['setter' => 'setBei', 'value' => 'BEI'], |
|
23
|
|
|
['setter' => 'setEangln', 'value' => 'EANGLN'], |
|
24
|
|
|
['setter' => 'setChipsUniversalId', 'value' => 'USCHU'], |
|
25
|
|
|
['setter' => 'setDuns', 'value' => 'DUNS'], |
|
26
|
|
|
['setter' => 'setBankPartyId', 'value' => 'BkPtyId'], |
|
27
|
|
|
['setter' => 'setTaxId', 'value' => 'TaxIdNb'], |
|
28
|
|
|
]; |
|
29
|
|
|
|
|
30
|
1 |
|
$organisationIdentification = new DTO\OrganisationIdentification(); |
|
31
|
|
|
|
|
32
|
1 |
|
static::map($organisationIdentification, $xmlOrganisationIdentification, $mapping); |
|
33
|
|
|
|
|
34
|
1 |
|
if (isset($xmlOrganisationIdentification->PrtryId)) { |
|
35
|
1 |
|
$other = $xmlOrganisationIdentification->PrtryId; |
|
36
|
|
|
} |
|
37
|
1 |
|
if (isset($xmlOrganisationIdentification->Othr)) { |
|
38
|
|
|
$other = $xmlOrganisationIdentification->Othr; |
|
39
|
|
|
} |
|
40
|
|
|
|
|
41
|
1 |
|
if (isset($other)) { |
|
42
|
1 |
|
if (isset($other->Id)) { |
|
43
|
1 |
|
$organisationIdentification->setOtherId( |
|
44
|
1 |
|
(string) $other->Id |
|
45
|
|
|
); |
|
46
|
|
|
} |
|
47
|
1 |
|
if (isset($other->Issr)) { |
|
48
|
1 |
|
$organisationIdentification->setOtherIssuer( |
|
49
|
1 |
|
(string) $other->Issr |
|
50
|
|
|
); |
|
51
|
|
|
} |
|
52
|
1 |
|
if (isset($other->Tp)) { |
|
53
|
|
|
$organisationIdentification->setOtherType( |
|
54
|
|
|
(string) $other->Tp |
|
55
|
|
|
); |
|
56
|
|
|
} |
|
57
|
1 |
|
if (isset($other->SchmeNm)) { |
|
|
|
|
|
|
58
|
|
|
$organisationIdentification->setOtherSchemeName( |
|
59
|
|
|
(string) $other->SchmeNm |
|
60
|
|
|
); |
|
61
|
|
|
} |
|
62
|
|
|
} |
|
63
|
|
|
|
|
64
|
1 |
|
return $organisationIdentification; |
|
65
|
|
|
} |
|
66
|
|
|
} |
|
67
|
|
|
|