You are here

public function AbstractFeed::setBaseUrl in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php \Zend\Feed\Writer\AbstractFeed::setBaseUrl()

Set the feed's base URL

Parameters

string $url:

Return value

AbstractFeed

Throws

Exception\InvalidArgumentException

File

vendor/zendframework/zend-feed/src/Writer/AbstractFeed.php, line 429

Class

AbstractFeed

Namespace

Zend\Feed\Writer

Code

public function setBaseUrl($url) {
  if (empty($url) || !is_string($url) || !Uri::factory($url)
    ->isValid()) {
    throw new Exception\InvalidArgumentException('Invalid parameter: "url" array value' . ' must be a non-empty string and valid URI/IRI');
  }
  $this->data['baseUrl'] = $url;
  return $this;
}