@@ 50-60 (lines=11) @@ | ||
47 | { |
|
48 | foreach ($embeddeds as $embedded) { |
|
49 | if ($embedded->getData() instanceof \Traversable || is_array($embedded->getData())) { |
|
50 | foreach ($embedded->getData() as $data) { |
|
51 | $entryNode = $visitor->getDocument()->createElement('resource'); |
|
52 | ||
53 | $visitor->getCurrentNode()->appendChild($entryNode); |
|
54 | $visitor->setCurrentNode($entryNode); |
|
55 | $visitor->getCurrentNode()->setAttribute('rel', $embedded->getRel()); |
|
56 | ||
57 | $this->acceptDataAndAppend($embedded, $data, $visitor, $context); |
|
58 | ||
59 | $visitor->revertCurrentNode(); |
|
60 | } |
|
61 | ||
62 | continue; |
|
63 | } |
@@ 34-44 (lines=11) @@ | ||
31 | */ |
|
32 | public function serializeLinks(array $links, XmlSerializationVisitor $visitor, SerializationContext $context) |
|
33 | { |
|
34 | foreach ($links as $link) { |
|
35 | $linkNode = $visitor->getDocument()->createElement('link'); |
|
36 | $visitor->getCurrentNode()->appendChild($linkNode); |
|
37 | ||
38 | $linkNode->setAttribute('rel', $link->getRel()); |
|
39 | $linkNode->setAttribute('href', $link->getHref()); |
|
40 | ||
41 | foreach ($link->getAttributes() as $attributeName => $attributeValue) { |
|
42 | $linkNode->setAttribute($attributeName, $attributeValue); |
|
43 | } |
|
44 | } |
|
45 | } |
|
46 | ||
47 | /** |