public function findOne($parameters): Model
    {
        if ($parameters instanceof Query) {
            $parameters = $parameters->compileParameters();
        }

        $parameters = $this->formatParameters($parameters, self::ENDPOINT_SINGLE);
        $url = $this->urlSingle.'/'.$parameters['resource_id'].'/';

        $result = $this->client->loadResource($url, $parameters['parameters']);

        return new Model($this->name, $result);
    }
public function findOne($parameters): Model
    {
        if ($parameters instanceof Query) {
            $parameters = $parameters->compileParameters();
        }

        $parameters = $this->formatParameters($parameters, self::ENDPOINT_SINGLE);
        $url = $this->urlSingle.'/'.$parameters['resource_id'].'/';

        $result = $this->client->loadResource($url, $parameters['parameters']);

        return new Model($this->name, $result);
    }
public function findOne ( $ parameters ) : Model { if ( $ parameters instanceof Query ) { $ parameters = $ parameters -> compileParameters ( ) ; } $ parameters = $ this -> formatParameters ( $ parameters , self :: ENDPOINT_SINGLE ) ; $ url = $ this -> urlSingle . '/' . $ parameters [ 'resource_id' ] . '/' ; $ result = $ this -> client -> loadResource ( $ url , $ parameters [ 'parameters' ] ) ; return new Model ( $ this -> name , $ result ) ; }
Finds a single model with the given parameters.

@param array|Query $parameters

@return Model
Finds a single model with the given parameters .