You are here

public function Feed::getLicenses in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php \Zend\Feed\Reader\Extension\CreativeCommons\Feed::getLicenses()

Get the entry licenses

Return value

array

1 call to Feed::getLicenses()
Feed::getLicense in vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php
Get the entry license

File

vendor/zendframework/zend-feed/src/Reader/Extension/CreativeCommons/Feed.php, line 38

Class

Feed

Namespace

Zend\Feed\Reader\Extension\CreativeCommons

Code

public function getLicenses() {
  $name = 'licenses';
  if (array_key_exists($name, $this->data)) {
    return $this->data[$name];
  }
  $licenses = [];
  $list = $this->xpath
    ->evaluate('channel/cc:license');
  if ($list->length) {
    foreach ($list as $license) {
      $licenses[] = $license->nodeValue;
    }
    $licenses = array_unique($licenses);
  }
  $this->data[$name] = $licenses;
  return $this->data[$name];
}