public static function fromAMQPMessage(AMQPMessage $message) {

        $envelope = new self();
        $envelope->app_id = $message->has('app_id') ? $message->get('app_id') : '';
        $envelope->body = $message->body;
        $envelope->content_encoding  = $message->has('content_encoding') ? $message->get('content_encoding') : '';
        $envelope->content_type = $message->has('content_type') ? $message->get('content_type') : '';
        $envelope->correlation_id = $message->has('correlation_id') ? $message->get('correlation_id') : '';
        $envelope->delivery_mode = $message->has('delivery_mode') ? $message->get('delivery_mode') : '';
        $envelope->delivery_tag = $message->has('delivery_tag') ? $message->get('delivery_tag') : '';
        $envelope->exchange_name = $message->has('exchange') ? $message->get('exchange') : '';
        $envelope->expiration = $message->has('expiration') ? $message->get('expiration') : '';
        $envelope->headers = $message->has('application_headers') ? $message->get('application_headers')->getNativeData() : '';
        $envelope->message_id = $message->has('message_id') ? $message->get('message_id') : '';
        $envelope->priority = $message->has('priority') ? $message->get('priority') : '';
        $envelope->reply_to = $message->has('reply_to') ? $message->get('reply_to') : '';
        $envelope->routing_key = $message->has('routing_key') ? $message->get('routing_key') : '';
        $envelope->timestamp = $message->has('timestamp') ? $message->get('timestamp') : '';
        $envelope->type = $message->has('type') ? $message->get('type') : '';
        $envelope->user_id = $message->has('user_id') ? $message->get('user_id') : '';
        $envelope->is_redelivery = $message->has('redelivered') ? $message->get('redelivered') : '';

        return $envelope;
    }
public static function fromAMQPMessage(AMQPMessage $message) {

        $envelope = new self();
        $envelope->app_id = $message->has('app_id') ? $message->get('app_id') : '';
        $envelope->body = $message->body;
        $envelope->content_encoding  = $message->has('content_encoding') ? $message->get('content_encoding') : '';
        $envelope->content_type = $message->has('content_type') ? $message->get('content_type') : '';
        $envelope->correlation_id = $message->has('correlation_id') ? $message->get('correlation_id') : '';
        $envelope->delivery_mode = $message->has('delivery_mode') ? $message->get('delivery_mode') : '';
        $envelope->delivery_tag = $message->has('delivery_tag') ? $message->get('delivery_tag') : '';
        $envelope->exchange_name = $message->has('exchange') ? $message->get('exchange') : '';
        $envelope->expiration = $message->has('expiration') ? $message->get('expiration') : '';
        $envelope->headers = $message->has('application_headers') ? $message->get('application_headers')->getNativeData() : '';
        $envelope->message_id = $message->has('message_id') ? $message->get('message_id') : '';
        $envelope->priority = $message->has('priority') ? $message->get('priority') : '';
        $envelope->reply_to = $message->has('reply_to') ? $message->get('reply_to') : '';
        $envelope->routing_key = $message->has('routing_key') ? $message->get('routing_key') : '';
        $envelope->timestamp = $message->has('timestamp') ? $message->get('timestamp') : '';
        $envelope->type = $message->has('type') ? $message->get('type') : '';
        $envelope->user_id = $message->has('user_id') ? $message->get('user_id') : '';
        $envelope->is_redelivery = $message->has('redelivered') ? $message->get('redelivered') : '';

        return $envelope;
    }
public static function fromAMQPMessage ( AMQPMessage $ message ) { $ envelope = new self ( ) ; $ envelope -> app_id = $ message -> has ( 'app_id' ) ? $ message -> get ( 'app_id' ) : '' ; $ envelope -> body = $ message -> body ; $ envelope -> content_encoding = $ message -> has ( 'content_encoding' ) ? $ message -> get ( 'content_encoding' ) : '' ; $ envelope -> content_type = $ message -> has ( 'content_type' ) ? $ message -> get ( 'content_type' ) : '' ; $ envelope -> correlation_id = $ message -> has ( 'correlation_id' ) ? $ message -> get ( 'correlation_id' ) : '' ; $ envelope -> delivery_mode = $ message -> has ( 'delivery_mode' ) ? $ message -> get ( 'delivery_mode' ) : '' ; $ envelope -> delivery_tag = $ message -> has ( 'delivery_tag' ) ? $ message -> get ( 'delivery_tag' ) : '' ; $ envelope -> exchange_name = $ message -> has ( 'exchange' ) ? $ message -> get ( 'exchange' ) : '' ; $ envelope -> expiration = $ message -> has ( 'expiration' ) ? $ message -> get ( 'expiration' ) : '' ; $ envelope -> headers = $ message -> has ( 'application_headers' ) ? $ message -> get ( 'application_headers' ) -> getNativeData ( ) : '' ; $ envelope -> message_id = $ message -> has ( 'message_id' ) ? $ message -> get ( 'message_id' ) : '' ; $ envelope -> priority = $ message -> has ( 'priority' ) ? $ message -> get ( 'priority' ) : '' ; $ envelope -> reply_to = $ message -> has ( 'reply_to' ) ? $ message -> get ( 'reply_to' ) : '' ; $ envelope -> routing_key = $ message -> has ( 'routing_key' ) ? $ message -> get ( 'routing_key' ) : '' ; $ envelope -> timestamp = $ message -> has ( 'timestamp' ) ? $ message -> get ( 'timestamp' ) : '' ; $ envelope -> type = $ message -> has ( 'type' ) ? $ message -> get ( 'type' ) : '' ; $ envelope -> user_id = $ message -> has ( 'user_id' ) ? $ message -> get ( 'user_id' ) : '' ; $ envelope -> is_redelivery = $ message -> has ( 'redelivered' ) ? $ message -> get ( 'redelivered' ) : '' ; return $ envelope ; }
Build AMQPEnvelope from a php-amqplib message;

@param AMQPMessage $message
@return AMQPEnvelope
Build AMQPEnvelope from a php - amqplib message ;