public function setImage($url, $title = null, $link = null)
    {
        if (!is_string($url) || empty($url))
            throw new \InvalidArgumentException('url parameter must be a string and may not be empty or NULL.');

        // RSS feeds have support for a title & link element.
        if ($this->version != Feed::ATOM)
        {
            if (!is_string($title) || empty($title))
                throw new \InvalidArgumentException('title parameter must be a string and may not be empty or NULL.');
            if (!is_string($link) || empty($link))
                throw new \InvalidArgumentException('link parameter must be a string and may not be empty or NULL.');

            $data = array('title'=>$title, 'link'=>$link, 'url'=>$url);
            $name = 'image';
        }
        else
        {
            $name = 'logo';
            $data = $url;
        }

        // Special handling for RSS1 again (since RSS1 is a bit strange...)
        if ($this->version == Feed::RSS1)
        {
            $this->data['Image'] = $data;
            return $this->setChannelElement($name, '', array('rdf:resource' => $url), false);
        }
        else
            return $this->setChannelElement($name, $data);
    }
public function setImage($url, $title = null, $link = null)
    {
        if (!is_string($url) || empty($url))
            throw new \InvalidArgumentException('url parameter must be a string and may not be empty or NULL.');

        // RSS feeds have support for a title & link element.
        if ($this->version != Feed::ATOM)
        {
            if (!is_string($title) || empty($title))
                throw new \InvalidArgumentException('title parameter must be a string and may not be empty or NULL.');
            if (!is_string($link) || empty($link))
                throw new \InvalidArgumentException('link parameter must be a string and may not be empty or NULL.');

            $data = array('title'=>$title, 'link'=>$link, 'url'=>$url);
            $name = 'image';
        }
        else
        {
            $name = 'logo';
            $data = $url;
        }

        // Special handling for RSS1 again (since RSS1 is a bit strange...)
        if ($this->version == Feed::RSS1)
        {
            $this->data['Image'] = $data;
            return $this->setChannelElement($name, '', array('rdf:resource' => $url), false);
        }
        else
            return $this->setChannelElement($name, $data);
    }
public function setImage ( $ url , $ title = null , $ link = null ) { if ( ! is_string ( $ url ) || empty ( $ url ) ) throw new \ InvalidArgumentException ( 'url parameter must be a string and may not be empty or NULL.' ) ; // RSS feeds have support for a title & link element. if ( $ this -> version != Feed :: ATOM ) { if ( ! is_string ( $ title ) || empty ( $ title ) ) throw new \ InvalidArgumentException ( 'title parameter must be a string and may not be empty or NULL.' ) ; if ( ! is_string ( $ link ) || empty ( $ link ) ) throw new \ InvalidArgumentException ( 'link parameter must be a string and may not be empty or NULL.' ) ; $ data = array ( 'title' => $ title , 'link' => $ link , 'url' => $ url ) ; $ name = 'image' ; } else { $ name = 'logo' ; $ data = $ url ; } // Special handling for RSS1 again (since RSS1 is a bit strange...) if ( $ this -> version == Feed :: RSS1 ) { $ this -> data [ 'Image' ] = $ data ; return $ this -> setChannelElement ( $ name , '' , array ( 'rdf:resource' => $ url ) , false ) ; } else return $ this -> setChannelElement ( $ name , $ data ) ; }
Set the 'image' channel element

@access   public
@param    string $url URL of the image
@param    string $title Title of the image. RSS only.
@param    string $link Link target URL of the image. RSS only.
@return   self
@throws   \InvalidArgumentException if the url is invalid.
@throws   \InvalidArgumentException if the title and link parameter are not a string or empty.
Set the image channel element