You are here

public function Feed::getImage in Zircon Profile 8

Same name in this branch
  1. 8 core/modules/aggregator/src/Entity/Feed.php \Drupal\aggregator\Entity\Feed::getImage()
  2. 8 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php \Zend\Feed\Reader\Extension\Atom\Feed::getImage()
Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php \Zend\Feed\Reader\Extension\Atom\Feed::getImage()

Get the feed image

Return value

array|null

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Feed.php, line 268

Class

Feed

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getImage() {
  if (array_key_exists('image', $this->data)) {
    return $this->data['image'];
  }
  $imageUrl = $this->xpath
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/atom:logo)');
  if (!$imageUrl) {
    $image = null;
  }
  else {
    $image = [
      'uri' => $imageUrl,
    ];
  }
  $this->data['image'] = $image;
  return $this->data['image'];
}