1 | <?php |
||
17 | class Message |
||
18 | { |
||
19 | /** |
||
20 | * The text so be send. |
||
21 | * |
||
22 | * @var string |
||
23 | */ |
||
24 | protected $text; |
||
25 | |||
26 | /** |
||
27 | * The URL for the avatar image. |
||
28 | * |
||
29 | * @var string |
||
30 | */ |
||
31 | protected $icon_emoji = ''; |
||
32 | |||
33 | /** |
||
34 | * @var array<T3Bot\Slack\Message\Attachment> |
||
35 | */ |
||
36 | protected $attachments = []; |
||
37 | |||
38 | /** |
||
39 | * Constructor for a message. |
||
40 | * |
||
41 | * @param array $data |
||
42 | */ |
||
43 | 28 | public function __construct(array $data = []) |
|
54 | |||
55 | /** |
||
56 | * @return string |
||
57 | */ |
||
58 | 5 | public function getText() : string |
|
62 | |||
63 | /** |
||
64 | * @param string $text |
||
65 | */ |
||
66 | 28 | public function setText($text) |
|
70 | |||
71 | /** |
||
72 | * @return string |
||
73 | */ |
||
74 | 1 | public function getIconEmoji() : string |
|
78 | |||
79 | /** |
||
80 | * @param string $icon_emoji |
||
81 | */ |
||
82 | 1 | public function setIconEmoji($icon_emoji) |
|
86 | |||
87 | /** |
||
88 | * @return array |
||
89 | */ |
||
90 | 15 | public function getAttachments() : array |
|
94 | |||
95 | /** |
||
96 | * @param array $attachments |
||
97 | */ |
||
98 | 1 | public function setAttachments($attachments) |
|
102 | |||
103 | /** |
||
104 | * @param Attachment $attachment |
||
105 | */ |
||
106 | 27 | public function addAttachment(Attachment $attachment) |
|
110 | } |
||
111 |