Core/src/LongRunning/OperationResponseTrait.php
private function operationToArray($operation, $serializer, array $lroMappers)
    {
        $response = $operation->getLastProtoResponse();
        if (is_null($response)) {
            return null;
        }

        $response = $serializer->encodeMessage($response);

        $result = null;
        if ($operation->isDone()) {
            $type = $response['metadata']['typeUrl'];
            $result = $this->deserializeResult($operation, $type, $serializer, $lroMappers);
        }

        $error = $operation->getError();
        if (!is_null($error)) {
            $error = $serializer->encodeMessage($error);
        }

        $response['response'] = $result;
        $response['error'] = $error;

        return $response;
    }
private function operationToArray($operation, $serializer, array $lroMappers)
    {
        $response = $operation->getLastProtoResponse();
        if (is_null($response)) {
            return null;
        }

        $response = $serializer->encodeMessage($response);

        $result = null;
        if ($operation->isDone()) {
            $type = $response['metadata']['typeUrl'];
            $result = $this->deserializeResult($operation, $type, $serializer, $lroMappers);
        }

        $error = $operation->getError();
        if (!is_null($error)) {
            $error = $serializer->encodeMessage($error);
        }

        $response['response'] = $result;
        $response['error'] = $error;

        return $response;
    }
private function operationToArray ( $ operation , $ serializer , array $ lroMappers ) { $ response = $ operation -> getLastProtoResponse ( ) ; if ( is_null ( $ response ) ) { return null ; } $ response = $ serializer -> encodeMessage ( $ response ) ; $ result = null ; if ( $ operation -> isDone ( ) ) { $ type = $ response [ 'metadata' ] [ 'typeUrl' ] ; $ result = $ this -> deserializeResult ( $ operation , $ type , $ serializer , $ lroMappers ) ; } $ error = $ operation -> getError ( ) ; if ( ! is_null ( $ error ) ) { $ error = $ serializer -> encodeMessage ( $ error ) ; } $ response [ 'response' ] = $ result ; $ response [ 'error' ] = $ error ; return $ response ; }
Convert a ApiCore OperationResponse object to an array.

@param OperationResponse|GaxOperationResponse $operation The operation response
@param Serializer|GaxSerializer $serializer The serializer to use for gRPC serialization/deserialization.
@param array $lroMappers A list of mappers for deserializing operation results.
@return array
Convert a ApiCore OperationResponse object to an array .