src/Model/ApiResourceBase.php
public static function get($id, $collectionUrl = null, ClientInterface $client)
    {
        try {
            $url = $collectionUrl ? rtrim($collectionUrl, '/') . '/' . urlencode($id) : $id;
            $request = new Request('get', $url);
            $data = self::send($request, $client);

            return new static($data, $url, $client, true);
        } catch (BadResponseException $e) {
            $response = $e->getResponse();
            if ($response && $response->getStatusCode() === 404) {
                return false;
            }
            throw $e;
        }
    }
public static function get($id, $collectionUrl = null, ClientInterface $client)
    {
        try {
            $url = $collectionUrl ? rtrim($collectionUrl, '/') . '/' . urlencode($id) : $id;
            $request = new Request('get', $url);
            $data = self::send($request, $client);

            return new static($data, $url, $client, true);
        } catch (BadResponseException $e) {
            $response = $e->getResponse();
            if ($response && $response->getStatusCode() === 404) {
                return false;
            }
            throw $e;
        }
    }
public static function get ( $ id , $ collectionUrl = null , ClientInterface $ client ) { try { $ url = $ collectionUrl ? rtrim ( $ collectionUrl , '/' ) . '/' . urlencode ( $ id ) : $ id ; $ request = new Request ( 'get' , $ url ) ; $ data = self :: send ( $ request , $ client ) ; return new static ( $ data , $ url , $ client , true ) ; } catch ( BadResponseException $ e ) { $ response = $ e -> getResponse ( ) ; if ( $ response && $ response -> getStatusCode ( ) === 404 ) { return false ; } throw $ e ; } }
Get a resource by its ID.

@param string          $id            The ID of the resource, or the
full URL.
@param string          $collectionUrl The URL of the collection.
@param ClientInterface $client        A suitably configured Guzzle
client.

@return static|false The resource object, or false if the resource is
not found.
Get a resource by its ID .