Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
message.php
1<?php
2
4
5use Bitrix\Calendar\Core;
6
8{
10 private array $body = [];
12 private array $headers = [];
14 private array $properties = [];
16 private ?int $id = null;
17
22 public function setId(?int $id): Message
23 {
24 $this->id = $id;
25
26 return $this;
27 }
28
32 public function getId(): ?int
33 {
34 return $this->id;
35 }
36
40 public function getBody(): array
41 {
42 return $this->body;
43 }
44
49 public function setBody($body): self
50 {
51 $this->body = $body;
52
53 return $this;
54 }
55
60 public function setProperties(array $properties): self
61 {
62 $this->properties = $properties;
63
64 return $this;
65 }
66
72 public function setProperty(string $name, $value): self
73 {
74 $this->properties[$name] = $value;
75
76 return $this;
77 }
78
82 public function getProperties(): array
83 {
84 return $this->properties;
85 }
86
92 public function getProperty(string $name, $default = null)
93 {
94 return array_key_exists($name, $this->properties)
95 ? $this->properties[$name]
96 : $default
97 ;
98 }
99
105 public function setHeader(string $name, $value): self
106 {
107 $this->headers[$name] = $value;
108
109 return $this;
110 }
111
116 public function setHeaders(array $headers): self
117 {
118 $this->headers = $headers;
119
120 return $this;
121 }
122
126 public function getHeaders(): array
127 {
128 return $this->headers;
129 }
130
136 public function getHeader(string $name, $default = null)
137 {
138 return array_key_exists($name, $this->headers)
139 ? $this->headers[$name]
140 : $default
141 ;
142 }
143
148 public function setRoutingKey(string $routingKey = null): self
149 {
150 $this->setHeader('routingKey', $routingKey);
151
152 return $this;
153 }
154
158 public function getRoutingKey(): ?string
159 {
160 return $this->getHeader('routingKey');
161 }
162}
getHeader(string $name, $default=null)
Definition message.php:136
setRoutingKey(string $routingKey=null)
Definition message.php:148
getProperty(string $name, $default=null)
Definition message.php:92
getHeader(string $name, $default=null)