@@ 58-80 (lines=23) @@ | ||
55 | $this->payloadFactory = new PayloadFactory; |
|
56 | } |
|
57 | ||
58 | public function deserialize($serializedData) |
|
59 | { |
|
60 | $xpath = $this->getPayloadAsXPath($serializedData); |
|
61 | foreach ($xpath->query($this->getSubpayloadXPath()) as $subpayloadNode) { |
|
62 | switch ($subpayloadNode->nodeName) { |
|
63 | case 'MailingAddress': |
|
64 | $pl = $this->getEmptyMailingAddress(); |
|
65 | break; |
|
66 | case 'StoreLocation': |
|
67 | $pl = $this->getEmptyStoreLocation(); |
|
68 | break; |
|
69 | case 'Email': |
|
70 | $pl = $this->getEmptyEmailAddress(); |
|
71 | break; |
|
72 | } |
|
73 | if (isset($pl)) { |
|
74 | $pl->deserialize($subpayloadNode->C14N()); |
|
75 | $this->offsetSet($pl); |
|
76 | } |
|
77 | } |
|
78 | $this->validate(); |
|
79 | return $this; |
|
80 | } |
|
81 | ||
82 | protected function serializeContents() |
|
83 | { |
@@ 56-75 (lines=20) @@ | ||
53 | $this->payloadFactory = new PayloadFactory; |
|
54 | } |
|
55 | ||
56 | public function deserialize($serializedData) |
|
57 | { |
|
58 | $xpath = $this->getPayloadAsXPath($serializedData); |
|
59 | foreach ($xpath->query($this->getSubpayloadXPath()) as $subpayloadNode) { |
|
60 | switch ($subpayloadNode->nodeName) { |
|
61 | case 'MailingAddress': |
|
62 | $pl = $this->getEmptyMailingAddress(); |
|
63 | break; |
|
64 | case 'Email': |
|
65 | $pl = $this->getEmptyEmailAddress(); |
|
66 | break; |
|
67 | } |
|
68 | if (isset($pl)) { |
|
69 | $pl->deserialize($subpayloadNode->C14N()); |
|
70 | $this->offsetSet($pl); |
|
71 | } |
|
72 | } |
|
73 | $this->validate(); |
|
74 | return $this; |
|
75 | } |
|
76 | ||
77 | protected function serializeContents() |
|
78 | { |