Joli\Jane\OpenApi\Tests\Expected\Resource\DefaultResource::getThingsById PHP Method

getThingsById() public method

public getThingsById ( array $parameters = [], string $fetch = self::FETCH_OBJECT ) : Psr\Http\Message\ResponseInterface | Thing[]
$parameters array List of parameters
$fetch string Fetch mode (object or response)
return Psr\Http\Message\ResponseInterface | Joli\Jane\OpenApi\Tests\Expected\Model\Thing[]
    public function getThingsById($parameters = [], $fetch = self::FETCH_OBJECT)
    {
        $queryParam = new QueryParam();
        $url = '/things/{id}';
        $url = $url . ('?' . $queryParam->buildQueryString($parameters));
        $headers = array_merge(['Host' => 'localhost'], $queryParam->buildHeaders($parameters));
        $body = $queryParam->buildFormDataString($parameters);
        $request = $this->messageFactory->createRequest('GET', $url, $headers, $body);
        $promise = $this->httpClient->sendAsyncRequest($request);
        if (self::FETCH_PROMISE === $fetch) {
            return $promise;
        }
        $response = $promise->wait();
        if (self::FETCH_OBJECT == $fetch) {
            if ('200' == $response->getStatusCode()) {
                return $this->serializer->deserialize((string) $response->getBody(), 'Joli\\Jane\\OpenApi\\Tests\\Expected\\Model\\Thing[]', 'json');
            }
        }
        return $response;
    }