FeedWriter\Feed::addNamespace PHP Method

addNamespace() public method

Add a XML namespace to the internal list of namespaces. After that, custom channel elements can be used properly to generate a valid feed.
public addNamespace ( string $prefix, string $uri ) : self
$prefix string namespace prefix
$uri string namespace name (URI)
return self
    public function addNamespace($prefix, $uri)
    {
        if (empty($prefix)) {
            throw new \InvalidArgumentException('The prefix may not be emtpy or NULL.');
        }
        if (empty($uri)) {
            throw new \InvalidArgumentException('The uri may not be empty or NULL.');
        }
        $this->namespaces[$prefix] = $uri;
        return $this;
    }