comparison vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Feed.php @ 16:c2387f117808

Routine composer update
author Chris Cannam
date Tue, 10 Jul 2018 15:07:59 +0100
parents 7a779792577d
children
comparison
equal deleted inserted replaced
15:e200cb7efeb3 16:c2387f117808
1 <?php 1 <?php
2 /** 2 /**
3 * Zend Framework (http://framework.zend.com/) 3 * @see https://github.com/zendframework/zend-feed for the canonical source repository
4 * 4 * @copyright Copyright (c) 2005-2018 Zend Technologies USA Inc. (https://www.zend.com)
5 * @link http://github.com/zendframework/zf2 for the canonical source repository 5 * @license https://github.com/zendframework/zend-feed/blob/master/LICENSE.md New BSD License
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 */ 6 */
9 7
10 namespace Zend\Feed\Reader\Extension\Podcast; 8 namespace Zend\Feed\Reader\Extension\Podcast;
11 9
12 use DOMText; 10 use DOMText;
13 use Zend\Feed\Reader\Extension; 11 use Zend\Feed\Reader\Extension;
14 12
15 /**
16 */
17 class Feed extends Extension\AbstractFeed 13 class Feed extends Extension\AbstractFeed
18 { 14 {
19 /** 15 /**
20 * Get the entry author 16 * Get the entry author
21 * 17 *
123 119
124 return $this->data['explicit']; 120 return $this->data['explicit'];
125 } 121 }
126 122
127 /** 123 /**
128 * Get the entry image 124 * Get the feed/podcast image
129 * 125 *
130 * @return string 126 * @return string
131 */ 127 */
132 public function getItunesImage() 128 public function getItunesImage()
133 { 129 {
147 } 143 }
148 144
149 /** 145 /**
150 * Get the entry keywords 146 * Get the entry keywords
151 * 147 *
148 * @deprecated since 2.10.0; itunes:keywords is no longer part of the
149 * iTunes podcast RSS specification.
152 * @return string 150 * @return string
153 */ 151 */
154 public function getKeywords() 152 public function getKeywords()
155 { 153 {
154 trigger_error(
155 'itunes:keywords has been deprecated in the iTunes podcast RSS specification,'
156 . ' and should not be relied on.',
157 \E_USER_DEPRECATED
158 );
159
156 if (isset($this->data['keywords'])) { 160 if (isset($this->data['keywords'])) {
157 return $this->data['keywords']; 161 return $this->data['keywords'];
158 } 162 }
159 163
160 $keywords = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); 164 $keywords = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)');
264 268
265 return $this->data['summary']; 269 return $this->data['summary'];
266 } 270 }
267 271
268 /** 272 /**
273 * Get the type of podcast
274 *
275 * @return string One of "episodic" or "serial". Defaults to "episodic"
276 * if no itunes:type tag is encountered.
277 */
278 public function getPodcastType()
279 {
280 if (isset($this->data['podcastType'])) {
281 return $this->data['podcastType'];
282 }
283
284 $type = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:type)');
285
286 if (! $type) {
287 $type = 'episodic';
288 }
289
290 $this->data['podcastType'] = (string) $type;
291
292 return $this->data['podcastType'];
293 }
294
295 /**
296 * Is the podcast complete (no more episodes will post)?
297 *
298 * @return bool
299 */
300 public function isComplete()
301 {
302 if (isset($this->data['complete'])) {
303 return $this->data['complete'];
304 }
305
306 $complete = $this->xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:complete)');
307
308 if (! $complete) {
309 $complete = false;
310 }
311
312 $this->data['complete'] = $complete === 'Yes';
313
314 return $this->data['complete'];
315 }
316
317 /**
269 * Register iTunes namespace 318 * Register iTunes namespace
270 * 319 *
271 */ 320 */
272 protected function registerNamespaces() 321 protected function registerNamespaces()
273 { 322 {