You are here

public function Feed::getLanguage in Zircon Profile 8

Same name in this branch
  1. 8 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php \Zend\Feed\Reader\Extension\Atom\Feed::getLanguage()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php \Zend\Feed\Reader\Extension\DublinCore\Feed::getLanguage()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php \Zend\Feed\Reader\Extension\DublinCore\Feed::getLanguage()

Get the feed language

Return value

string|null

File

vendor/zendframework/zend-feed/src/Reader/Extension/DublinCore/Feed.php, line 158

Class

Feed

Namespace

Zend\Feed\Reader\Extension\DublinCore

Code

public function getLanguage() {
  if (array_key_exists('language', $this->data)) {
    return $this->data['language'];
  }
  $language = $this
    ->getXpath()
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/dc11:language)');
  if (!$language) {
    $language = $this
      ->getXpath()
      ->evaluate('string(' . $this
      ->getXpathPrefix() . '/dc10:language)');
  }
  if (!$language) {
    $language = null;
  }
  $this->data['language'] = $language;
  return $this->data['language'];
}