You are here

public function Entry::getBaseUrl in Zircon Profile 8

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

Get the base URI of the feed (if set).

Return value

string|null

1 call to Entry::getBaseUrl()
Entry::absolutiseUri in vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php
Attempt to absolutise the URI, i.e. if a relative URI apply the xml:base value as a prefix to turn into an absolute URI.

File

vendor/zendframework/zend-feed/src/Reader/Extension/Atom/Entry.php, line 294

Class

Entry

Namespace

Zend\Feed\Reader\Extension\Atom

Code

public function getBaseUrl() {
  if (array_key_exists('baseUrl', $this->data)) {
    return $this->data['baseUrl'];
  }
  $baseUrl = $this
    ->getXpath()
    ->evaluate('string(' . $this
    ->getXpathPrefix() . '/@xml:base[1]' . ')');
  if (!$baseUrl) {
    $baseUrl = $this
      ->getXpath()
      ->evaluate('string(//@xml:base[1])');
  }
  if (!$baseUrl) {
    $baseUrl = null;
  }
  $this->data['baseUrl'] = $baseUrl;
  return $this->data['baseUrl'];
}