public function load(UriInterface $uri, array $options = []): PromiseInterface
    {
        /** @var DataService $annotation */
        $annotation = $this->dataService->getAnnotation();

        if (!isset($options['query'])) {
            $options['query'] = [];
        }
        $options['query'] = $options['query'] += [
            'schema' => $annotation->schemaVersion,
            'form' => 'cjson',
        ];

        if ($this->authenticatedClient->hasAccount()) {
            $options['query']['account'] = (string) $this->authenticatedClient->getAccount()->getMpxId();
        }

        if ('http' == $uri->getScheme()) {
            $uri = $uri->withScheme('https');
        }

        $response = $this->authenticatedClient->requestAsync('GET', $uri, $options)->then(
            function (ResponseInterface $response) {
                return $this->deserialize($response->getBody(), $this->dataService->getClass());
            }
        );

        return $response;
    }
public function load(UriInterface $uri, array $options = []): PromiseInterface
    {
        /** @var DataService $annotation */
        $annotation = $this->dataService->getAnnotation();

        if (!isset($options['query'])) {
            $options['query'] = [];
        }
        $options['query'] = $options['query'] += [
            'schema' => $annotation->schemaVersion,
            'form' => 'cjson',
        ];

        if ($this->authenticatedClient->hasAccount()) {
            $options['query']['account'] = (string) $this->authenticatedClient->getAccount()->getMpxId();
        }

        if ('http' == $uri->getScheme()) {
            $uri = $uri->withScheme('https');
        }

        $response = $this->authenticatedClient->requestAsync('GET', $uri, $options)->then(
            function (ResponseInterface $response) {
                return $this->deserialize($response->getBody(), $this->dataService->getClass());
            }
        );

        return $response;
    }
public function load ( UriInterface $ uri , array $ options = [ ] ) : PromiseInterface { /** @var DataService $annotation */ $ annotation = $ this -> dataService -> getAnnotation ( ) ; if ( ! isset ( $ options [ 'query' ] ) ) { $ options [ 'query' ] = [ ] ; } $ options [ 'query' ] = $ options [ 'query' ] += [ 'schema' => $ annotation -> schemaVersion , 'form' => 'cjson' , ] ; if ( $ this -> authenticatedClient -> hasAccount ( ) ) { $ options [ 'query' ] [ 'account' ] = ( string ) $ this -> authenticatedClient -> getAccount ( ) -> getMpxId ( ) ; } if ( 'http' == $ uri -> getScheme ( ) ) { $ uri = $ uri -> withScheme ( 'https' ) ; } $ response = $ this -> authenticatedClient -> requestAsync ( 'GET' , $ uri , $ options ) -> then ( function ( ResponseInterface $ response ) { return $ this -> deserialize ( $ response -> getBody ( ) , $ this -> dataService -> getClass ( ) ) ; } ) ; return $ response ; }
Load an object from mpx.

@param \Psr\Http\Message\UriInterface $uri     The URI to load from. This URI will always be converted to https,
making it safe to use directly from the ID of an mpx object.
@param array                          $options (optional) An array of HTTP client options.

@return PromiseInterface A promise to return a \Lullabot\Mpx\DataService\ObjectInterface.
Load an object from mpx .