Chris@16
|
1 <?php
|
Chris@16
|
2 /**
|
Chris@16
|
3 * @see https://github.com/zendframework/zend-feed for the canonical source repository
|
Chris@16
|
4 * @copyright Copyright (c) 2018 Zend Technologies USA Inc. (https://www.zend.com)
|
Chris@16
|
5 * @license https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
|
Chris@16
|
6 */
|
Chris@16
|
7
|
Chris@16
|
8 namespace Zend\Feed\Reader\Extension\GooglePlayPodcast;
|
Chris@16
|
9
|
Chris@16
|
10 use Zend\Feed\Reader\Extension;
|
Chris@16
|
11
|
Chris@16
|
12 class Entry extends Extension\AbstractEntry
|
Chris@16
|
13 {
|
Chris@16
|
14 /**
|
Chris@16
|
15 * Get the entry block
|
Chris@16
|
16 *
|
Chris@16
|
17 * @return string
|
Chris@16
|
18 */
|
Chris@16
|
19 public function getPlayPodcastBlock()
|
Chris@16
|
20 {
|
Chris@16
|
21 if (isset($this->data['block'])) {
|
Chris@16
|
22 return $this->data['block'];
|
Chris@16
|
23 }
|
Chris@16
|
24
|
Chris@16
|
25 $block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:block)');
|
Chris@16
|
26
|
Chris@16
|
27 if (! $block) {
|
Chris@16
|
28 $block = null;
|
Chris@16
|
29 }
|
Chris@16
|
30
|
Chris@16
|
31 $this->data['block'] = $block;
|
Chris@16
|
32
|
Chris@16
|
33 return $this->data['block'];
|
Chris@16
|
34 }
|
Chris@16
|
35
|
Chris@16
|
36 /**
|
Chris@16
|
37 * Get the entry explicit
|
Chris@16
|
38 *
|
Chris@16
|
39 * @return string
|
Chris@16
|
40 */
|
Chris@16
|
41 public function getPlayPodcastExplicit()
|
Chris@16
|
42 {
|
Chris@16
|
43 if (isset($this->data['explicit'])) {
|
Chris@16
|
44 return $this->data['explicit'];
|
Chris@16
|
45 }
|
Chris@16
|
46
|
Chris@16
|
47 $explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:explicit)');
|
Chris@16
|
48
|
Chris@16
|
49 if (! $explicit) {
|
Chris@16
|
50 $explicit = null;
|
Chris@16
|
51 }
|
Chris@16
|
52
|
Chris@16
|
53 $this->data['explicit'] = $explicit;
|
Chris@16
|
54
|
Chris@16
|
55 return $this->data['explicit'];
|
Chris@16
|
56 }
|
Chris@16
|
57
|
Chris@16
|
58 /**
|
Chris@16
|
59 * Get the episode summary/description
|
Chris@16
|
60 *
|
Chris@16
|
61 * Uses verbiage so it does not conflict with base entry.
|
Chris@16
|
62 *
|
Chris@16
|
63 * @return string
|
Chris@16
|
64 */
|
Chris@16
|
65 public function getPlayPodcastDescription()
|
Chris@16
|
66 {
|
Chris@16
|
67 if (isset($this->data['description'])) {
|
Chris@16
|
68 return $this->data['description'];
|
Chris@16
|
69 }
|
Chris@16
|
70
|
Chris@16
|
71 $description = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/googleplay:description)');
|
Chris@16
|
72
|
Chris@16
|
73 if (! $description) {
|
Chris@16
|
74 $description = null;
|
Chris@16
|
75 }
|
Chris@16
|
76
|
Chris@16
|
77 $this->data['description'] = $description;
|
Chris@16
|
78
|
Chris@16
|
79 return $this->data['description'];
|
Chris@16
|
80 }
|
Chris@16
|
81
|
Chris@16
|
82 /**
|
Chris@16
|
83 * Register googleplay namespace
|
Chris@16
|
84 *
|
Chris@16
|
85 */
|
Chris@16
|
86 protected function registerNamespaces()
|
Chris@16
|
87 {
|
Chris@16
|
88 $this->xpath->registerNamespace('googleplay', 'http://www.google.com/schemas/play-podcasts/1.0');
|
Chris@16
|
89 }
|
Chris@16
|
90 }
|