Chris@2: data['author'])) { Chris@2: return $this->data['author']; Chris@2: } Chris@2: Chris@2: $author = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:author)'); Chris@2: Chris@2: if (! $author) { Chris@2: $author = null; Chris@2: } Chris@2: Chris@2: $this->data['author'] = $author; Chris@2: Chris@2: return $this->data['author']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Get the entry block Chris@2: * Chris@2: * @return string Chris@2: */ Chris@2: public function getPlayPodcastBlock() Chris@2: { Chris@2: if (isset($this->data['block'])) { Chris@2: return $this->data['block']; Chris@2: } Chris@2: Chris@2: $block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:block)'); Chris@2: Chris@2: if (! $block) { Chris@2: $block = null; Chris@2: } Chris@2: Chris@2: $this->data['block'] = $block; Chris@2: Chris@2: return $this->data['block']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Get the entry category Chris@2: * Chris@2: * @return array|null Chris@2: */ Chris@2: public function getPlayPodcastCategories() Chris@2: { Chris@2: if (isset($this->data['categories'])) { Chris@2: return $this->data['categories']; Chris@2: } Chris@2: Chris@2: $categoryList = $this->xpath->query($this->getXpathPrefix() . '/googleplay:category'); Chris@2: Chris@2: $categories = []; Chris@2: Chris@2: if ($categoryList->length > 0) { Chris@2: foreach ($categoryList as $node) { Chris@2: $children = null; Chris@2: Chris@2: if ($node->childNodes->length > 0) { Chris@2: $children = []; Chris@2: Chris@2: foreach ($node->childNodes as $childNode) { Chris@2: if (! ($childNode instanceof DOMText)) { Chris@2: $children[$childNode->getAttribute('text')] = null; Chris@2: } Chris@2: } Chris@2: } Chris@2: Chris@2: $categories[$node->getAttribute('text')] = $children; Chris@2: } Chris@2: } Chris@2: Chris@2: if (! $categories) { Chris@2: $categories = null; Chris@2: } Chris@2: Chris@2: $this->data['categories'] = $categories; Chris@2: Chris@2: return $this->data['categories']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Get the entry explicit Chris@2: * Chris@2: * @return string Chris@2: */ Chris@2: public function getPlayPodcastExplicit() Chris@2: { Chris@2: if (isset($this->data['explicit'])) { Chris@2: return $this->data['explicit']; Chris@2: } Chris@2: Chris@2: $explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:explicit)'); Chris@2: Chris@2: if (! $explicit) { Chris@2: $explicit = null; Chris@2: } Chris@2: Chris@2: $this->data['explicit'] = $explicit; Chris@2: Chris@2: return $this->data['explicit']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Get the feed/podcast image Chris@2: * Chris@2: * @return string Chris@2: */ Chris@2: public function getPlayPodcastImage() Chris@2: { Chris@2: if (isset($this->data['image'])) { Chris@2: return $this->data['image']; Chris@2: } Chris@2: Chris@2: $image = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:image/@href)'); Chris@2: Chris@2: if (! $image) { Chris@2: $image = null; Chris@2: } Chris@2: Chris@2: $this->data['image'] = $image; Chris@2: Chris@2: return $this->data['image']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Get the entry description Chris@2: * Chris@2: * @return string Chris@2: */ Chris@2: public function getPlayPodcastDescription() Chris@2: { Chris@2: if (isset($this->data['description'])) { Chris@2: return $this->data['description']; Chris@2: } Chris@2: Chris@2: $description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:description)'); Chris@2: Chris@2: if (! $description) { Chris@2: $description = null; Chris@2: } Chris@2: Chris@2: $this->data['description'] = $description; Chris@2: Chris@2: return $this->data['description']; Chris@2: } Chris@2: Chris@2: /** Chris@2: * Register googleplay namespace Chris@2: * Chris@2: */ Chris@2: protected function registerNamespaces() Chris@2: { Chris@2: $this->xpath->registerNamespace('googleplay', 'http://www.google.com/schemas/play-podcasts/1.0'); Chris@2: } Chris@2: }