src/Model/ApiResourceBase.php
public function getLink($rel, $absolute = true)
    {
        if (!$this->hasLink($rel)) {
            throw new \InvalidArgumentException("Link not found: $rel");
        }
        $url = $this->data['_links'][$rel]['href'];
        if ($absolute && strpos($url, '//') === false) {
            $url = $this->makeAbsoluteUrl($url);
        }
        return $url;
    }
public function getLink($rel, $absolute = true)
    {
        if (!$this->hasLink($rel)) {
            throw new \InvalidArgumentException("Link not found: $rel");
        }
        $url = $this->data['_links'][$rel]['href'];
        if ($absolute && strpos($url, '//') === false) {
            $url = $this->makeAbsoluteUrl($url);
        }
        return $url;
    }
public function getLink ( $ rel , $ absolute = true ) { if ( ! $ this -> hasLink ( $ rel ) ) { throw new \ InvalidArgumentException ( "Link not found: $rel" ) ; } $ url = $ this -> data [ '_links' ] [ $ rel ] [ 'href' ] ; if ( $ absolute && strpos ( $ url , '//' ) === false ) { $ url = $ this -> makeAbsoluteUrl ( $ url ) ; } return $ url ; }
Get a link for a given resource relation.

@param string $rel
@param bool   $absolute

@return string
Get a link for a given resource relation .