X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs-website;a=blobdiff_plain;f=vendor%2Fzendframework%2Fzend-feed%2Fsrc%2FWriter%2FExtension%2FGooglePlayPodcast%2FRenderer%2FEntry.php;fp=vendor%2Fzendframework%2Fzend-feed%2Fsrc%2FWriter%2FExtension%2FGooglePlayPodcast%2FRenderer%2FEntry.php;h=b828402dbb443283e1e190a3f9b961d6f54903b0;hp=0000000000000000000000000000000000000000;hb=0bf8d09d2542548982e81a441b1f16e75873a04f;hpb=74df008bdbb3a11eeea356744f39b802369bda3c diff --git a/vendor/zendframework/zend-feed/src/Writer/Extension/GooglePlayPodcast/Renderer/Entry.php b/vendor/zendframework/zend-feed/src/Writer/Extension/GooglePlayPodcast/Renderer/Entry.php new file mode 100644 index 000000000..b828402db --- /dev/null +++ b/vendor/zendframework/zend-feed/src/Writer/Extension/GooglePlayPodcast/Renderer/Entry.php @@ -0,0 +1,120 @@ +_setBlock($this->dom, $this->base); + $this->_setExplicit($this->dom, $this->base); + $this->_setDescription($this->dom, $this->base); + if ($this->called) { + $this->_appendNamespaces(); + } + } + + /** + * Append namespaces to entry root + * + * @return void + */ + // @codingStandardsIgnoreStart + protected function _appendNamespaces() + { + // @codingStandardsIgnoreEnd + $this->getRootElement()->setAttribute( + 'xmlns:googleplay', + 'http://www.google.com/schemas/play-podcasts/1.0' + ); + } + + /** + * Set itunes block + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + // @codingStandardsIgnoreStart + protected function _setBlock(DOMDocument $dom, DOMElement $root) + { + // @codingStandardsIgnoreEnd + $block = $this->getDataContainer()->getPlayPodcastBlock(); + if ($block === null) { + return; + } + $el = $dom->createElement('googleplay:block'); + $text = $dom->createTextNode($block); + $el->appendChild($text); + $root->appendChild($el); + $this->called = true; + } + + /** + * Set explicit flag + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + // @codingStandardsIgnoreStart + protected function _setExplicit(DOMDocument $dom, DOMElement $root) + { + // @codingStandardsIgnoreEnd + $explicit = $this->getDataContainer()->getPlayPodcastExplicit(); + if ($explicit === null) { + return; + } + $el = $dom->createElement('googleplay:explicit'); + $text = $dom->createTextNode($explicit); + $el->appendChild($text); + $root->appendChild($el); + $this->called = true; + } + + /** + * Set episode description + * + * @param DOMDocument $dom + * @param DOMElement $root + * @return void + */ + // @codingStandardsIgnoreStart + protected function _setDescription(DOMDocument $dom, DOMElement $root) + { + // @codingStandardsIgnoreEnd + $description = $this->getDataContainer()->getPlayPodcastDescription(); + if (! $description) { + return; + } + $el = $dom->createElement('googleplay:description'); + $text = $dom->createTextNode($description); + $el->appendChild($text); + $root->appendChild($el); + $this->called = true; + } +}