@@ 80-101 (lines=22) @@ | ||
77 | * |
|
78 | * @return self |
|
79 | */ |
|
80 | protected function deserializeDestination(DOMXPath $xpath) |
|
81 | { |
|
82 | $destinationNode = $xpath->query('x:Shipping/x:ShippedAddress|x:Shipping/x:StoreFrontAddress')->item(0); |
|
83 | if ($destinationNode) { |
|
84 | $mailingAddress = static::MAILING_ADDRESS_INTERFACE; |
|
85 | $storeFront = static::STORE_FRONT_DETAILS_INTERFACE; |
|
86 | $destination = null; |
|
87 | switch ($destinationNode->nodeName) { |
|
88 | case $mailingAddress::ROOT_NODE: |
|
89 | $destination = $this->buildPayloadForInterface($mailingAddress); |
|
90 | break; |
|
91 | case $storeFront::ROOT_NODE: |
|
92 | $destination = $this->buildPayloadForInterface($storeFront); |
|
93 | break; |
|
94 | } |
|
95 | if ($destination) { |
|
96 | $destination->deserialize($destinationNode->C14N()); |
|
97 | $this->setDestination($destination); |
|
98 | } |
|
99 | } |
|
100 | return $this; |
|
101 | } |
|
102 | ||
103 | /** |
|
104 | * Deserialize the EstimatedShipDate to a DateTime object. |
@@ 119-138 (lines=20) @@ | ||
116 | return $this->deserializeShippingDestination($xpath); |
|
117 | } |
|
118 | ||
119 | protected function deserializeShippingDestination(DOMXPath $xpath) |
|
120 | { |
|
121 | $destinationNode = $xpath->query('x:ShippedDestination/*')->item(0); |
|
122 | $mailingAddress = static::MAILING_ADDRESS_INTERFACE; |
|
123 | $storeFront = static::STORE_FRONT_DETAILS_INTERFACE; |
|
124 | $destination = null; |
|
125 | switch ($destinationNode->nodeName) { |
|
126 | case $mailingAddress::ROOT_NODE: |
|
127 | $destination = $this->buildPayloadForInterface($mailingAddress); |
|
128 | break; |
|
129 | case $storeFront::ROOT_NODE: |
|
130 | $destination = $this->buildPayloadForInterface($storeFront); |
|
131 | break; |
|
132 | } |
|
133 | if ($destination) { |
|
134 | $destination->deserialize($destinationNode->C14N()); |
|
135 | $this->setShippingDestination($destination); |
|
136 | } |
|
137 | return $this; |
|
138 | } |
|
139 | ||
140 | protected function getRootAttributes() |
|
141 | { |