| 1 | <?php |
||
| 7 | class Message implements MessageInterface |
||
| 8 | { |
||
| 9 | protected $body; |
||
| 10 | protected $properties = array(); |
||
| 11 | protected $contentType = 'application/json'; |
||
| 12 | protected $queueName; |
||
| 13 | |||
| 14 | 6 | public function __construct($body, array $properties = array(), $contentType = null, $queueName = '') |
|
| 15 | { |
||
| 16 | 6 | $this->body = $body; |
|
| 17 | 6 | $this->properties = $properties; |
|
| 18 | 6 | if ($contentType != null) { |
|
| 19 | 6 | $this->contentType = $contentType; |
|
| 20 | } |
||
| 21 | 6 | $this->queueName = $queueName; |
|
| 22 | 6 | } |
|
| 23 | |||
| 24 | 6 | public function getBody() |
|
| 28 | |||
| 29 | /** |
||
| 30 | * @return string |
||
| 31 | */ |
||
| 32 | 6 | public function getContentType() |
|
| 36 | |||
| 37 | /** |
||
| 38 | * @return string |
||
| 39 | */ |
||
| 40 | public function getQueueName() |
||
| 44 | |||
| 45 | /** |
||
| 46 | * Check whether a property exists in the 'properties' dictionary |
||
| 47 | * @param string $name |
||
| 48 | * @return bool |
||
| 49 | */ |
||
| 50 | public function has($name) |
||
| 54 | |||
| 55 | /** |
||
| 56 | * @param string $name |
||
| 57 | * @throws \OutOfBoundsException |
||
| 58 | * @return mixed |
||
| 59 | */ |
||
| 60 | public function get($name) |
||
| 64 | |||
| 65 | /** |
||
| 66 | * Returns the properties content |
||
| 67 | * @return array |
||
| 68 | */ |
||
| 69 | public function getProperties() |
||
| 73 | } |
||
| 74 |