public function find($id)
    {
        $resourceName = constant($this->type . '::RESOURCE');

        $url      = sprintf("%s/%s/%s", self::ENDPOINT, $resourceName, $id);
        $response = $this->fetch($url, substr($resourceName, 0, strlen($resourceName) - 1));

        return new $this->type($response);
    }
public function find($id)
    {
        $resourceName = constant($this->type . '::RESOURCE');

        $url      = sprintf("%s/%s/%s", self::ENDPOINT, $resourceName, $id);
        $response = $this->fetch($url, substr($resourceName, 0, strlen($resourceName) - 1));

        return new $this->type($response);
    }
public function find ( $ id ) { $ resourceName = constant ( $ this -> type . '::RESOURCE' ) ; $ url = sprintf ( "%s/%s/%s" , self :: ENDPOINT , $ resourceName , $ id ) ; $ response = $ this -> fetch ( $ url , substr ( $ resourceName , 0 , strlen ( $ resourceName ) - 1 ) ) ; return new $ this -> type ( $ response ) ; }
Get a resource by its id

@param string $id Resource id

@return object
Get a resource by its id