Mercurial > hg > cmmr2012-drupal-site
comparison vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Entry.php @ 0:c75dbcec494b
Initial commit from drush-created site
author | Chris Cannam |
---|---|
date | Thu, 05 Jul 2018 14:24:15 +0000 |
parents | |
children | 5311817fb629 |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:c75dbcec494b |
---|---|
1 <?php | |
2 /** | |
3 * Zend Framework (http://framework.zend.com/) | |
4 * | |
5 * @link http://github.com/zendframework/zf2 for the canonical source repository | |
6 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) | |
7 * @license http://framework.zend.com/license/new-bsd New BSD License | |
8 */ | |
9 | |
10 namespace Zend\Feed\Reader\Extension\Podcast; | |
11 | |
12 use Zend\Feed\Reader\Extension; | |
13 | |
14 /** | |
15 */ | |
16 class Entry extends Extension\AbstractEntry | |
17 { | |
18 /** | |
19 * Get the entry author | |
20 * | |
21 * @return string | |
22 */ | |
23 public function getCastAuthor() | |
24 { | |
25 if (isset($this->data['author'])) { | |
26 return $this->data['author']; | |
27 } | |
28 | |
29 $author = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); | |
30 | |
31 if (!$author) { | |
32 $author = null; | |
33 } | |
34 | |
35 $this->data['author'] = $author; | |
36 | |
37 return $this->data['author']; | |
38 } | |
39 | |
40 /** | |
41 * Get the entry block | |
42 * | |
43 * @return string | |
44 */ | |
45 public function getBlock() | |
46 { | |
47 if (isset($this->data['block'])) { | |
48 return $this->data['block']; | |
49 } | |
50 | |
51 $block = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); | |
52 | |
53 if (!$block) { | |
54 $block = null; | |
55 } | |
56 | |
57 $this->data['block'] = $block; | |
58 | |
59 return $this->data['block']; | |
60 } | |
61 | |
62 /** | |
63 * Get the entry duration | |
64 * | |
65 * @return string | |
66 */ | |
67 public function getDuration() | |
68 { | |
69 if (isset($this->data['duration'])) { | |
70 return $this->data['duration']; | |
71 } | |
72 | |
73 $duration = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:duration)'); | |
74 | |
75 if (!$duration) { | |
76 $duration = null; | |
77 } | |
78 | |
79 $this->data['duration'] = $duration; | |
80 | |
81 return $this->data['duration']; | |
82 } | |
83 | |
84 /** | |
85 * Get the entry explicit | |
86 * | |
87 * @return string | |
88 */ | |
89 public function getExplicit() | |
90 { | |
91 if (isset($this->data['explicit'])) { | |
92 return $this->data['explicit']; | |
93 } | |
94 | |
95 $explicit = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); | |
96 | |
97 if (!$explicit) { | |
98 $explicit = null; | |
99 } | |
100 | |
101 $this->data['explicit'] = $explicit; | |
102 | |
103 return $this->data['explicit']; | |
104 } | |
105 | |
106 /** | |
107 * Get the entry keywords | |
108 * | |
109 * @return string | |
110 */ | |
111 public function getKeywords() | |
112 { | |
113 if (isset($this->data['keywords'])) { | |
114 return $this->data['keywords']; | |
115 } | |
116 | |
117 $keywords = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); | |
118 | |
119 if (!$keywords) { | |
120 $keywords = null; | |
121 } | |
122 | |
123 $this->data['keywords'] = $keywords; | |
124 | |
125 return $this->data['keywords']; | |
126 } | |
127 | |
128 /** | |
129 * Get the entry subtitle | |
130 * | |
131 * @return string | |
132 */ | |
133 public function getSubtitle() | |
134 { | |
135 if (isset($this->data['subtitle'])) { | |
136 return $this->data['subtitle']; | |
137 } | |
138 | |
139 $subtitle = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); | |
140 | |
141 if (!$subtitle) { | |
142 $subtitle = null; | |
143 } | |
144 | |
145 $this->data['subtitle'] = $subtitle; | |
146 | |
147 return $this->data['subtitle']; | |
148 } | |
149 | |
150 /** | |
151 * Get the entry summary | |
152 * | |
153 * @return string | |
154 */ | |
155 public function getSummary() | |
156 { | |
157 if (isset($this->data['summary'])) { | |
158 return $this->data['summary']; | |
159 } | |
160 | |
161 $summary = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); | |
162 | |
163 if (!$summary) { | |
164 $summary = null; | |
165 } | |
166 | |
167 $this->data['summary'] = $summary; | |
168 | |
169 return $this->data['summary']; | |
170 } | |
171 | |
172 /** | |
173 * Register iTunes namespace | |
174 * | |
175 */ | |
176 protected function registerNamespaces() | |
177 { | |
178 $this->xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); | |
179 } | |
180 } |