Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add LabelLinksIndicator to LabelDelivery for ShipmentServiceOption #331

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions src/Entity/LabelDelivery.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ class LabelDelivery implements NodeInterface
*/
public $LabelLinkIndicator;

/**
* @var boolean
*/
public $LabelLinksIndicator;

/**
* @var string
*/
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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));
}
Expand Down Expand Up @@ -155,6 +170,24 @@ public function setLabelLinkIndicator($labelLinkIndicator)
return $this;
}

/**
* @return string
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @return string
* @return boolean

*/
public function getLabelLinksIndicator()
{
return $this->LabelLinksIndicator;
}

/**
* @return $this
*/
public function setLabelLinksIndicator($labelLinksIndicator)
{
$this->LabelLinksIndicator = $labelLinksIndicator;

return $this;
}

/**
* @return string
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ShipmentServiceOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'));
Expand Down