public function setUrl($url)
    {
        $url = parse_url($url);

        $this->setHost($url['host']);

        if(isset($url['port']))
        {
            $this->setPort($url['port']);
        }

        return $this;
    }
public function setUrl($url)
    {
        $url = parse_url($url);

        $this->setHost($url['host']);

        if(isset($url['port']))
        {
            $this->setPort($url['port']);
        }

        return $this;
    }
public function setUrl ( $ url ) { $ url = parse_url ( $ url ) ; $ this -> setHost ( $ url [ 'host' ] ) ; if ( isset ( $ url [ 'port' ] ) ) { $ this -> setPort ( $ url [ 'port' ] ) ; } return $ this ; }
Set the host and port using an URL

@param   string  $url
@return $this
Set the host and port using an URL