3 * Zend Framework (http://framework.zend.com/)
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
10 namespace Zend\Feed\Reader\Extension\CreativeCommons;
12 use Zend\Feed\Reader\Extension;
14 class Feed extends Extension\AbstractFeed
17 * Get the entry license
22 public function getLicense($index = 0)
24 $licenses = $this->getLicenses();
26 if (isset($licenses[$index])) {
27 return $licenses[$index];
34 * Get the entry licenses
38 public function getLicenses()
41 if (array_key_exists($name, $this->data)) {
42 return $this->data[$name];
46 $list = $this->xpath->evaluate('channel/cc:license');
49 foreach ($list as $license) {
50 $licenses[] = $license->nodeValue;
53 $licenses = array_unique($licenses);
56 $this->data[$name] = $licenses;
58 return $this->data[$name];
62 * Register Creative Commons namespaces
66 protected function registerNamespaces()
68 $this->xpath->registerNamespace('cc', 'http://backend.userland.com/creativeCommonsRssModule');