File indexing completed on 2025-01-19 05:21:05
0001 <?php 0002 /** 0003 * Zend Framework 0004 * 0005 * LICENSE 0006 * 0007 * This source file is subject to the new BSD license that is bundled 0008 * with this package in the file LICENSE.txt. 0009 * It is also available through the world-wide-web at this URL: 0010 * http://framework.zend.com/license/new-bsd 0011 * If you did not receive a copy of the license and are unable to 0012 * obtain it through the world-wide-web, please send an email 0013 * to license@zend.com so we can send you a copy immediately. 0014 * 0015 * @category Zend 0016 * @package Zend_Feed_Reader 0017 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0018 * @license http://framework.zend.com/license/new-bsd New BSD License 0019 * @version $Id$ 0020 */ 0021 0022 /** 0023 * @see Zend_Feed_Reader 0024 */ 0025 // require_once 'Zend/Feed/Reader.php'; 0026 0027 /** 0028 * @see Zend_Feed_Reader_Extension_EntryAbstract 0029 */ 0030 // require_once 'Zend/Feed/Reader/Extension/EntryAbstract.php'; 0031 0032 /** 0033 * @category Zend 0034 * @package Zend_Feed_Reader 0035 * @copyright Copyright (c) 2005-2015 Zend Technologies USA Inc. (http://www.zend.com) 0036 * @license http://framework.zend.com/license/new-bsd New BSD License 0037 */ 0038 class Zend_Feed_Reader_Extension_Podcast_Entry extends Zend_Feed_Reader_Extension_EntryAbstract 0039 { 0040 /** 0041 * Get the entry author 0042 * 0043 * @return string 0044 */ 0045 public function getCastAuthor() 0046 { 0047 if (isset($this->_data['author'])) { 0048 return $this->_data['author']; 0049 } 0050 0051 $author = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:author)'); 0052 0053 if (!$author) { 0054 $author = null; 0055 } 0056 0057 $this->_data['author'] = $author; 0058 0059 return $this->_data['author']; 0060 } 0061 0062 /** 0063 * Get the entry block 0064 * 0065 * @return string 0066 */ 0067 public function getBlock() 0068 { 0069 if (isset($this->_data['block'])) { 0070 return $this->_data['block']; 0071 } 0072 0073 $block = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:block)'); 0074 0075 if (!$block) { 0076 $block = null; 0077 } 0078 0079 $this->_data['block'] = $block; 0080 0081 return $this->_data['block']; 0082 } 0083 0084 /** 0085 * Get the entry duration 0086 * 0087 * @return string 0088 */ 0089 public function getDuration() 0090 { 0091 if (isset($this->_data['duration'])) { 0092 return $this->_data['duration']; 0093 } 0094 0095 $duration = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:duration)'); 0096 0097 if (!$duration) { 0098 $duration = null; 0099 } 0100 0101 $this->_data['duration'] = $duration; 0102 0103 return $this->_data['duration']; 0104 } 0105 0106 /** 0107 * Get the entry explicit 0108 * 0109 * @return string 0110 */ 0111 public function getExplicit() 0112 { 0113 if (isset($this->_data['explicit'])) { 0114 return $this->_data['explicit']; 0115 } 0116 0117 $explicit = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:explicit)'); 0118 0119 if (!$explicit) { 0120 $explicit = null; 0121 } 0122 0123 $this->_data['explicit'] = $explicit; 0124 0125 return $this->_data['explicit']; 0126 } 0127 0128 /** 0129 * Get the entry keywords 0130 * 0131 * @return string 0132 */ 0133 public function getKeywords() 0134 { 0135 if (isset($this->_data['keywords'])) { 0136 return $this->_data['keywords']; 0137 } 0138 0139 $keywords = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:keywords)'); 0140 0141 if (!$keywords) { 0142 $keywords = null; 0143 } 0144 0145 $this->_data['keywords'] = $keywords; 0146 0147 return $this->_data['keywords']; 0148 } 0149 0150 /** 0151 * Get the entry subtitle 0152 * 0153 * @return string 0154 */ 0155 public function getSubtitle() 0156 { 0157 if (isset($this->_data['subtitle'])) { 0158 return $this->_data['subtitle']; 0159 } 0160 0161 $subtitle = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:subtitle)'); 0162 0163 if (!$subtitle) { 0164 $subtitle = null; 0165 } 0166 0167 $this->_data['subtitle'] = $subtitle; 0168 0169 return $this->_data['subtitle']; 0170 } 0171 0172 /** 0173 * Get the entry summary 0174 * 0175 * @return string 0176 */ 0177 public function getSummary() 0178 { 0179 if (isset($this->_data['summary'])) { 0180 return $this->_data['summary']; 0181 } 0182 0183 $summary = $this->_xpath->evaluate('string(' . $this->getXpathPrefix() . '/itunes:summary)'); 0184 0185 if (!$summary) { 0186 $summary = null; 0187 } 0188 0189 $this->_data['summary'] = $summary; 0190 0191 return $this->_data['summary']; 0192 } 0193 0194 /** 0195 * Register iTunes namespace 0196 * 0197 */ 0198 protected function _registerNamespaces() 0199 { 0200 $this->_xpath->registerNamespace('itunes', 'http://www.itunes.com/dtds/podcast-1.0.dtd'); 0201 } 0202 }