Updated Drupal to 8.6. This goes with the following updates because it's possible...
[yaffs-website] / vendor / zendframework / zend-feed / src / Writer / Extension / ITunes / Renderer / Feed.php
index 7bce80d4b204a8cde152a44a6808f7de665995d4..6614e3ffbd3525c53c1e3b2922779084a2f0a4cc 100644 (file)
@@ -44,6 +44,8 @@ class Feed extends Extension\AbstractRenderer
         $this->_setOwners($this->dom, $this->base);
         $this->_setSubtitle($this->dom, $this->base);
         $this->_setSummary($this->dom, $this->base);
+        $this->_setType($this->dom, $this->base);
+        $this->_setComplete($this->dom, $this->base);
         if ($this->called) {
             $this->_appendNamespaces();
         }
@@ -326,4 +328,48 @@ class Feed extends Extension\AbstractRenderer
         $root->appendChild($el);
         $this->called = true;
     }
+
+    /**
+     * Set podcast type
+     *
+     * @param  DOMDocument $dom
+     * @param  DOMElement $root
+     * @return void
+     */
+    // @codingStandardsIgnoreStart
+    protected function _setType(DOMDocument $dom, DOMElement $root)
+    {
+        // @codingStandardsIgnoreEnd
+        $type = $this->getDataContainer()->getItunesType();
+        if (! $type) {
+            return;
+        }
+        $el = $dom->createElement('itunes:type');
+        $text = $dom->createTextNode($type);
+        $el->appendChild($text);
+        $root->appendChild($el);
+        $this->called = true;
+    }
+
+    /**
+     * Set complete status
+     *
+     * @param  DOMDocument $dom
+     * @param  DOMElement $root
+     * @return void
+     */
+    // @codingStandardsIgnoreStart
+    protected function _setComplete(DOMDocument $dom, DOMElement $root)
+    {
+        // @codingStandardsIgnoreEnd
+        $status = $this->getDataContainer()->getItunesComplete();
+        if (! $status) {
+            return;
+        }
+        $el = $dom->createElement('itunes:complete');
+        $text = $dom->createTextNode('Yes');
+        $el->appendChild($text);
+        $root->appendChild($el);
+        $this->called = true;
+    }
 }