private function _authLink($urn, array $data = [])
    {
        if (empty($this->home)) {
            $this->home = new CollectionDocJson($this->_host);
        }

        // fetch the link
        $link = $this->home->auth($urn);
        if (!$link) {
            throw new LinkException("Unable to retrieve $urn from the home document");
        }

        // expand the link (data will be ignored unless it's an href-template)
        $url = $link->expand($data);

        // check hints
        $method = 'GET';
        if (!empty($link->hints) && !empty($link->hints->allow)) {
            $method = strtoupper($link->hints->allow[0]);
        }

        return [$method, $url];
    }
private function _authLink($urn, array $data = [])
    {
        if (empty($this->home)) {
            $this->home = new CollectionDocJson($this->_host);
        }

        // fetch the link
        $link = $this->home->auth($urn);
        if (!$link) {
            throw new LinkException("Unable to retrieve $urn from the home document");
        }

        // expand the link (data will be ignored unless it's an href-template)
        $url = $link->expand($data);

        // check hints
        $method = 'GET';
        if (!empty($link->hints) && !empty($link->hints->allow)) {
            $method = strtoupper($link->hints->allow[0]);
        }

        return [$method, $url];
    }
private function _authLink ( $ urn , array $ data = [ ] ) { if ( empty ( $ this -> home ) ) { $ this -> home = new CollectionDocJson ( $ this -> _host ) ; } // fetch the link $ link = $ this -> home -> auth ( $ urn ) ; if ( ! $ link ) { throw new LinkException ( "Unable to retrieve $urn from the home document" ) ; } // expand the link (data will be ignored unless it's an href-template) $ url = $ link -> expand ( $ data ) ; // check hints $ method = 'GET' ; if ( ! empty ( $ link -> hints ) && ! empty ( $ link -> hints -> allow ) ) { $ method = strtoupper ( $ link -> hints -> allow [ 0 ] ) ; } return [ $ method , $ url ] ; }
Fetch an auth link from the home doc

@param string $urn the URN of the link to get
@param array $data href-template params
@return array the method and URL for the requested link as array(string $method, string $url)
Fetch an auth link from the home doc