1 | <?php |
||
12 | class Message extends BaseMessageDecoder |
||
13 | { |
||
14 | /** |
||
15 | * @param DTO\Message $message |
||
16 | * @param SimpleXMLElement $document |
||
17 | */ |
||
18 | 4 | public function addRecords(DTO\Message $message, SimpleXMLElement $document) |
|
19 | { |
||
20 | 4 | $notifications = []; |
|
21 | |||
22 | 4 | $xmlNotifications = $this->getRootElement($document)->Ntfctn; |
|
|
|||
23 | 4 | foreach ($xmlNotifications as $xmlNotification) { |
|
24 | 4 | $notification = new Camt054DTO\Notification( |
|
25 | 4 | (string) $xmlNotification->Id, |
|
26 | 4 | new DateTimeImmutable((string)$xmlNotification->CreDtTm), |
|
27 | 4 | $this->getAccount($xmlNotification) |
|
28 | ); |
||
29 | |||
30 | 4 | if (isset($xmlNotification->NtfctnPgntn)) { |
|
31 | 3 | $notification->setPagination(new DTO\Pagination( |
|
32 | 3 | (string) $xmlNotification->NtfctnPgntn->PgNb, |
|
33 | 3 | ('true' === (string) $xmlNotification->NtfctnPgntn->LastPgInd) ? true : false |
|
34 | )); |
||
35 | } |
||
36 | |||
37 | 4 | if (isset($xmlNotification->AddtlNtfctnInf)) { |
|
38 | 3 | $notification->setAdditionalInformation((string) $xmlNotification->AddtlNtfctnInf); |
|
39 | } |
||
40 | |||
41 | 4 | $this->addCommonRecordInformation($notification, $xmlNotification); |
|
42 | 4 | $this->recordDecoder->addEntries($notification, $xmlNotification); |
|
43 | |||
44 | 4 | $notifications[] = $notification; |
|
45 | } |
||
46 | |||
47 | 4 | $message->setRecords($notifications); |
|
48 | 4 | } |
|
49 | |||
50 | /** |
||
51 | * {@inheritdoc} |
||
52 | */ |
||
53 | 5 | public function getRootElement(SimpleXMLElement $document) |
|
57 | |||
58 | /** |
||
59 | * @param SimpleXMLElement $xmlRecord |
||
60 | * |
||
61 | * @return DTO\Account |
||
62 | */ |
||
63 | 4 | protected function getAccount(SimpleXMLElement $xmlRecord) |
|
102 | } |
||
103 |
An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.
If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.