Envelope.php 814 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Framework\MessageQueue;
  7. use Magento\Framework\MessageQueue\EnvelopeInterface;
  8. class Envelope implements EnvelopeInterface
  9. {
  10. /**
  11. * @var array
  12. */
  13. private $properties;
  14. /**
  15. * @var string
  16. */
  17. private $body;
  18. /**
  19. * @param string $body
  20. * @param array $properties
  21. */
  22. public function __construct($body, array $properties = [])
  23. {
  24. $this->body = $body;
  25. $this->properties = $properties;
  26. }
  27. /**
  28. * {@inheritdoc}
  29. */
  30. public function getBody()
  31. {
  32. return $this->body;
  33. }
  34. /**
  35. * {@inheritdoc}
  36. */
  37. public function getProperties()
  38. {
  39. return $this->properties;
  40. }
  41. }