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