src/StatementClient.php
protected function buildQueryRequest(Request $request): Request
    {
        $sessionTransaction = $this->session->getTransactionId();
        $transactionId = is_null($sessionTransaction) ? 'NONE' : $sessionTransaction->toString();
        $request = $request->withAddedHeader(PrestoHeaders::PRESTO_CATALOG, $this->session->getCatalog())
            ->withAddedHeader(PrestoHeaders::PRESTO_SCHEMA, $this->session->getSchema())
            ->withAddedHeader(PrestoHeaders::PRESTO_SOURCE, $this->session->getSource())
            ->withAddedHeader(PrestoHeaders::PRESTO_TRANSACTION_ID, $transactionId);
        $sessionProperty = $this->session->getProperty();
        if (count($sessionProperty)) {
            $sessions = [];
            /** @var Property $property */
            foreach ($sessionProperty as $property) {
                $sessions[] = $property->getKey() . '=' . $property->getValue();
            }
            $request = $request->withAddedHeader(
                PrestoHeaders::PRESTO_SESSION,
                implode(',', $sessions)
            );
        }
        $preparedStatements = $this->session->getPreparedStatement();
        if (count($preparedStatements)) {
            $statements = [];
            foreach ($preparedStatements as $preparedStatement) {
                $statements[] = urlencode($preparedStatement->getKey())
                    . '=' . urlencode($preparedStatement->getValue());
            }
            $request = $request->withAddedHeader(
                PrestoHeaders::PRESTO_PREPARED_STATEMENT,
                implode(',', $statements)
            );
        }

        return $request;
    }
protected function buildQueryRequest(Request $request): Request
    {
        $sessionTransaction = $this->session->getTransactionId();
        $transactionId = is_null($sessionTransaction) ? 'NONE' : $sessionTransaction->toString();
        $request = $request->withAddedHeader(PrestoHeaders::PRESTO_CATALOG, $this->session->getCatalog())
            ->withAddedHeader(PrestoHeaders::PRESTO_SCHEMA, $this->session->getSchema())
            ->withAddedHeader(PrestoHeaders::PRESTO_SOURCE, $this->session->getSource())
            ->withAddedHeader(PrestoHeaders::PRESTO_TRANSACTION_ID, $transactionId);
        $sessionProperty = $this->session->getProperty();
        if (count($sessionProperty)) {
            $sessions = [];
            /** @var Property $property */
            foreach ($sessionProperty as $property) {
                $sessions[] = $property->getKey() . '=' . $property->getValue();
            }
            $request = $request->withAddedHeader(
                PrestoHeaders::PRESTO_SESSION,
                implode(',', $sessions)
            );
        }
        $preparedStatements = $this->session->getPreparedStatement();
        if (count($preparedStatements)) {
            $statements = [];
            foreach ($preparedStatements as $preparedStatement) {
                $statements[] = urlencode($preparedStatement->getKey())
                    . '=' . urlencode($preparedStatement->getValue());
            }
            $request = $request->withAddedHeader(
                PrestoHeaders::PRESTO_PREPARED_STATEMENT,
                implode(',', $statements)
            );
        }

        return $request;
    }
protected function buildQueryRequest ( Request $ request ) : Request { $ sessionTransaction = $ this -> session -> getTransactionId ( ) ; $ transactionId = is_null ( $ sessionTransaction ) ? 'NONE' : $ sessionTransaction -> toString ( ) ; $ request = $ request -> withAddedHeader ( PrestoHeaders :: PRESTO_CATALOG , $ this -> session -> getCatalog ( ) ) -> withAddedHeader ( PrestoHeaders :: PRESTO_SCHEMA , $ this -> session -> getSchema ( ) ) -> withAddedHeader ( PrestoHeaders :: PRESTO_SOURCE , $ this -> session -> getSource ( ) ) -> withAddedHeader ( PrestoHeaders :: PRESTO_TRANSACTION_ID , $ transactionId ) ; $ sessionProperty = $ this -> session -> getProperty ( ) ; if ( count ( $ sessionProperty ) ) { $ sessions = [ ] ; /** @var Property $property */ foreach ( $ sessionProperty as $ property ) { $ sessions [ ] = $ property -> getKey ( ) . '=' . $ property -> getValue ( ) ; } $ request = $ request -> withAddedHeader ( PrestoHeaders :: PRESTO_SESSION , implode ( ',' , $ sessions ) ) ; } $ preparedStatements = $ this -> session -> getPreparedStatement ( ) ; if ( count ( $ preparedStatements ) ) { $ statements = [ ] ; foreach ( $ preparedStatements as $ preparedStatement ) { $ statements [ ] = urlencode ( $ preparedStatement -> getKey ( ) ) . '=' . urlencode ( $ preparedStatement -> getValue ( ) ) ; } $ request = $ request -> withAddedHeader ( PrestoHeaders :: PRESTO_PREPARED_STATEMENT , implode ( ',' , $ statements ) ) ; } return $ request ; }
@param Request $request

@return Request
@param Request $request