You are here

public function Feed::getOwner in Zircon Profile 8

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

Get the entry owner

Return value

string

File

vendor/zendframework/zend-feed/src/Reader/Extension/Podcast/Feed.php, line 198

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Podcast

Code

public function getOwner() {
  if (isset($this->data['owner'])) {
    return $this->data['owner'];
  }
  $owner = null;
  $email = $this->xpath
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/itunes:owner/itunes:email)');
  $name = $this->xpath
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/itunes:owner/itunes:name)');
  if (!empty($email)) {
    $owner = $email . (empty($name) ? '' : ' (' . $name . ')');
  }
  elseif (!empty($name)) {
    $owner = $name;
  }
  if (!$owner) {
    $owner = null;
  }
  $this->data['owner'] = $owner;
  return $this->data['owner'];
}