7 * This source file is subject to the new BSD license that is bundled
8 * with this package in the file LICENSE.txt.
9 * It is also available through the world-wide-web at this URL:
10 * http://framework.zend.com/license/new-bsd
11 * If you did not receive a copy of the license and are unable to
12 * obtain it through the world-wide-web, please send an email
13 * to license@zend.com so we can send you a copy immediately.
16 * @package Zend_Feed_Reader
17 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
18 * @license http://framework.zend.com/license/new-bsd New BSD License
19 * @version $Id: Feed.php 16971 2009-07-22 18:05:45Z mikaelkael $
23 * @see Zend_Feed_Reader_Extension_FeedAbstract
25 require_once 'Zend/Feed/Reader/Extension/FeedAbstract.php';
29 * @package Zend_Feed_Reader
30 * @copyright Copyright (c) 2005-2009 Zend Technologies USA Inc. (http://www.zend.com)
31 * @license http://framework.zend.com/license/new-bsd New BSD License
33 class Zend_Feed_Reader_Extension_CreativeCommons_Feed
34 extends Zend_Feed_Reader_Extension_FeedAbstract
37 * Get the entry license
41 public function getLicense($index = 0)
43 $licenses = $this->getLicenses();
45 if (isset($licenses[$index])) {
46 return $licenses[$index];
53 * Get the entry licenses
57 public function getLicenses()
60 if (array_key_exists($name, $this->_data
)) {
61 return $this->_data
[$name];
65 $list = $this->_xpath
->evaluate('channel/cc:license');
68 foreach ($list as $license) {
69 $licenses[] = $license->nodeValue
;
72 $licenses = array_unique($licenses);
75 $this->_data
[$name] = $licenses;
77 return $this->_data
[$name];
81 * Register Creative Commons namespaces
85 protected function _registerNamespaces()
87 $this->_xpath
->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule');