zend-blog-3-backend
162 строки · 2.3 Кб
1<?php
2/**
3* Created by PhpStorm.
4* User: morontt
5* Date: 08.10.17
6* Time: 18:58
7*/
8
9namespace Xelbot\Telegram\Entity;
10
11class Message
12{
13/**
14* @var int
15*/
16protected $messageId;
17
18/**
19* @var User|null
20*/
21protected $from;
22
23/**
24* @var Chat|null
25*/
26protected $chat;
27
28/**
29* @var int
30*/
31protected $date;
32
33/**
34* @var string|null
35*/
36protected $text;
37
38/**
39* @var array
40*/
41protected $entities = [];
42
43/**
44* @return int
45*/
46public function getMessageId(): int
47{
48return $this->messageId;
49}
50
51/**
52* @param int $messageId
53*
54* @return Message
55*/
56public function setMessageId(int $messageId): self
57{
58$this->messageId = $messageId;
59
60return $this;
61}
62
63/**
64* @return User|null
65*/
66public function getFrom(): ?User
67{
68return $this->from;
69}
70
71/**
72* @param User|null $from
73*
74* @return Message
75*/
76public function setFrom(User $from = null): self
77{
78$this->from = $from;
79
80return $this;
81}
82
83/**
84* @return Chat|null
85*/
86public function getChat(): ?Chat
87{
88return $this->chat;
89}
90
91/**
92* @param Chat|null $chat
93*
94* @return Message
95*/
96public function setChat(Chat $chat = null): self
97{
98$this->chat = $chat;
99
100return $this;
101}
102
103/**
104* @return int
105*/
106public function getDate(): int
107{
108return $this->date;
109}
110
111/**
112* @param int $date
113*
114* @return Message
115*/
116public function setDate(int $date): self
117{
118$this->date = $date;
119
120return $this;
121}
122
123/**
124* @return string|null
125*/
126public function getText(): ?string
127{
128return $this->text;
129}
130
131/**
132* @param string|null $text
133*
134* @return Message
135*/
136public function setText(string $text = null): self
137{
138$this->text = $text;
139
140return $this;
141}
142
143/**
144* @return array
145*/
146public function getEntities(): array
147{
148return $this->entities;
149}
150
151/**
152* @param array $entities
153*
154* @return Message
155*/
156public function setEntities(array $entities): self
157{
158$this->entities = $entities;
159
160return $this;
161}
162}
163