@@ 138-154 (lines=17) @@ | ||
135 | * |
|
136 | * @return DOMElement |
|
137 | */ |
|
138 | public function toNode(DOMDocument $document = null) |
|
139 | { |
|
140 | if (null === $document) { |
|
141 | $document = new DOMDocument(); |
|
142 | } |
|
143 | ||
144 | $node = $document->createElement('ShipTo'); |
|
145 | $node->appendChild($document->createElement('CompanyName', $this->getCompanyName())); |
|
146 | $node->appendChild($document->createElement('AttentionName', $this->getAttentionName())); |
|
147 | ||
148 | $address = $this->getAddress(); |
|
149 | if (isset($address)) { |
|
150 | $node->appendChild($address->toNode($document)); |
|
151 | } |
|
152 | ||
153 | return $node; |
|
154 | } |
|
155 | ||
156 | /** |
|
157 | * @return Address |
@@ 146-162 (lines=17) @@ | ||
143 | * |
|
144 | * @return DOMElement |
|
145 | */ |
|
146 | public function toNode(DOMDocument $document = null) |
|
147 | { |
|
148 | if (null === $document) { |
|
149 | $document = new DOMDocument(); |
|
150 | } |
|
151 | ||
152 | $node = $document->createElement('ShipTo'); |
|
153 | $node->appendChild($document->createElement('CompanyName', $this->getCompanyName())); |
|
154 | $node->appendChild($document->createElement('AttentionName', $this->getAttentionName())); |
|
155 | ||
156 | $address = $this->getAddress(); |
|
157 | if (isset($address)) { |
|
158 | $node->appendChild($address->toNode($document)); |
|
159 | } |
|
160 | ||
161 | return $node; |
|
162 | } |
|
163 | ||
164 | /** |
|
165 | * @return Address |