Mercurial > hg > isophonics-drupal-site
comparison vendor/zendframework/zend-feed/src/Writer/Renderer/Feed/Atom.php @ 12:7a779792577d
Update Drupal core to v8.4.5 (via Composer)
author | Chris Cannam |
---|---|
date | Fri, 23 Feb 2018 15:52:07 +0000 |
parents | 4c8ae668cc8c |
children |
comparison
equal
deleted
inserted
replaced
11:bfffd8d7479a | 12:7a779792577d |
---|---|
32 * | 32 * |
33 * @return Atom | 33 * @return Atom |
34 */ | 34 */ |
35 public function render() | 35 public function render() |
36 { | 36 { |
37 if (!$this->container->getEncoding()) { | 37 if (! $this->container->getEncoding()) { |
38 $this->container->setEncoding('UTF-8'); | 38 $this->container->setEncoding('UTF-8'); |
39 } | 39 } |
40 $this->dom = new DOMDocument('1.0', $this->container->getEncoding()); | 40 $this->dom = new DOMDocument('1.0', $this->container->getEncoding()); |
41 $this->dom->formatOutput = true; | 41 $this->dom->formatOutput = true; |
42 $root = $this->dom->createElementNS( | 42 $root = $this->dom->createElementNS( |
62 $this->_setHubs($this->dom, $root); | 62 $this->_setHubs($this->dom, $root); |
63 | 63 |
64 foreach ($this->extensions as $ext) { | 64 foreach ($this->extensions as $ext) { |
65 $ext->setType($this->getType()); | 65 $ext->setType($this->getType()); |
66 $ext->setRootElement($this->getRootElement()); | 66 $ext->setRootElement($this->getRootElement()); |
67 $ext->setDOMDocument($this->getDOMDocument(), $root); | 67 $ext->setDomDocument($this->getDomDocument(), $root); |
68 $ext->render(); | 68 $ext->render(); |
69 } | 69 } |
70 | 70 |
71 foreach ($this->container as $entry) { | 71 foreach ($this->container as $entry) { |
72 if ($this->getDataContainer()->getEncoding()) { | 72 if ($this->getDataContainer()->getEncoding()) { |
73 $entry->setEncoding($this->getDataContainer()->getEncoding()); | 73 $entry->setEncoding($this->getDataContainer()->getEncoding()); |
74 } | 74 } |
75 if ($entry instanceof Writer\Entry) { | 75 if ($entry instanceof Writer\Entry) { |
76 $renderer = new Renderer\Entry\Atom($entry); | 76 $renderer = new Renderer\Entry\Atom($entry); |
77 } else { | 77 } else { |
78 if (!$this->dom->documentElement->hasAttribute('xmlns:at')) { | 78 if (! $this->dom->documentElement->hasAttribute('xmlns:at')) { |
79 $this->dom->documentElement->setAttribute( | 79 $this->dom->documentElement->setAttribute( |
80 'xmlns:at', | 80 'xmlns:at', |
81 'http://purl.org/atompub/tombstones/1.0' | 81 'http://purl.org/atompub/tombstones/1.0' |
82 ); | 82 ); |
83 } | 83 } |