public function getUrl() {
        $query = $this->getQuery();
        return
            $this->getScheme().
            '://'.
            $this->getHostAndPort().
            $this->getRoot().
            $this->getPath().
            (!empty($query) ? '?'.http_build_query($query) : '');
    }