From 25e8483fc8c884a95726d417e5f16ed6c26ae91c Mon Sep 17 00:00:00 2001 From: Xavi Baz Date: Thu, 30 Sep 2021 15:01:52 +0200 Subject: [PATCH] Add LabelLinksIndicator to LabelDelivery for ShipmentServiceOption --- src/Entity/LabelDelivery.php | 33 +++++++++++++++++++++++++++ src/Entity/ShipmentServiceOptions.php | 2 +- 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/src/Entity/LabelDelivery.php b/src/Entity/LabelDelivery.php index e5db1413..8fcec671 100644 --- a/src/Entity/LabelDelivery.php +++ b/src/Entity/LabelDelivery.php @@ -13,6 +13,11 @@ class LabelDelivery implements NodeInterface */ public $LabelLinkIndicator; + /** + * @var boolean + */ + public $LabelLinksIndicator; + /** * @var string */ @@ -55,11 +60,17 @@ public function __construct(\stdClass $response = null) { $this->LabelLinkIndicator = null; + $this->LabelLinksIndicator = null; + if (null !== $response) { if (isset($response->LabelLinkIndicator)) { $this->LabelLinkIndicator = true; } + if (isset($response->LabelLinksIndicator)) { + $this->LabelLinksIndicator = true; + } + if (isset($response->EMailAddress)) { $this->setEmailAddress($response->EMailAddress); } @@ -106,6 +117,10 @@ public function toNode(DOMDocument $document = null) $node->appendChild($document->createElement('LabelLinkIndicator', $this->LabelLinkIndicator)); } + if (isset($this->LabelLinksIndicator)) { + $node->appendChild($document->createElement('LabelLinksIndicator', $this->LabelLinksIndicator)); + } + if (isset($this->EMailAddress)) { $node->appendChild($document->createElement('EMailAddress', $this->EMailAddress)); } @@ -155,6 +170,24 @@ public function setLabelLinkIndicator($labelLinkIndicator) return $this; } + /** + * @return string + */ + public function getLabelLinksIndicator() + { + return $this->LabelLinksIndicator; + } + + /** + * @return $this + */ + public function setLabelLinksIndicator($labelLinksIndicator) + { + $this->LabelLinksIndicator = $labelLinksIndicator; + + return $this; + } + /** * @return string */ diff --git a/src/Entity/ShipmentServiceOptions.php b/src/Entity/ShipmentServiceOptions.php index b2b9f18d..fdea2284 100644 --- a/src/Entity/ShipmentServiceOptions.php +++ b/src/Entity/ShipmentServiceOptions.php @@ -188,7 +188,7 @@ public function toNode(DOMDocument $document = null) $emailMessageNode = $labelDeliveryNode->appendChild($document->createElement('EMailMessage')); $labelDelivery = $this->getLabelDelivery(); foreach ($labelDelivery as $key => $value) { - if ($key == 'LabelLinkIndicator') { + if ($key == 'LabelLinksIndicator') { $labelDeliveryNode->appendChild($document->createElement($key, $value)); } elseif ($key == 'SubjectCode') { $SubjectNode = $emailMessageNode->appendChild($document->createElement('Subject'));