public function getRelativeUrl()
    {
        $url = $this->getResourceUrl($this->resource, $this->idParam);

        if ($this->subresources && count($this->subresources)) {
            foreach($this->subresources as $subresource) {
                if ($subresource['name']) {
                    $url .= $this->getResourceUrl($subresource['name'], $subresource['id']);
                }
            }
        }

        return $url;
    }