|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/** |
|
4
|
|
|
* Class that represents Telegram's Bot-API "answerInlineQuery" method. |
|
5
|
|
|
* |
|
6
|
|
|
* @package Teebot (Telegram bot framework) |
|
7
|
|
|
* |
|
8
|
|
|
* @author Stanislav Drozdov <[email protected]> |
|
9
|
|
|
*/ |
|
10
|
|
|
|
|
11
|
|
|
namespace Teebot\Api\Method; |
|
12
|
|
|
|
|
13
|
|
|
use Teebot\Api\Entity\Inline\InlineQueryResultArray; |
|
14
|
|
|
|
|
15
|
|
|
class AnswerInlineQuery extends AbstractMethod |
|
16
|
|
|
{ |
|
17
|
|
|
const NAME = 'answerInlineQuery'; |
|
18
|
|
|
|
|
19
|
|
|
const RETURN_ENTITY = null; |
|
20
|
|
|
|
|
21
|
|
|
protected $inline_query_id; |
|
22
|
|
|
|
|
23
|
|
|
/** @var InlineQueryResultArray */ |
|
24
|
|
|
protected $results; |
|
25
|
|
|
|
|
26
|
|
|
protected $cache_time; |
|
27
|
|
|
|
|
28
|
|
|
protected $is_personal; |
|
29
|
|
|
|
|
30
|
|
|
protected $next_offset; |
|
31
|
|
|
|
|
32
|
|
|
protected $switch_pm_text; |
|
33
|
|
|
|
|
34
|
|
|
protected $switch_pm_parameter; |
|
35
|
|
|
|
|
36
|
|
|
protected $supportedProperties = [ |
|
37
|
|
|
'inline_query_id' => true, |
|
38
|
|
|
'results' => true, |
|
39
|
|
|
'cache_time' => false, |
|
40
|
|
|
'is_personal' => false, |
|
41
|
|
|
'next_offset' => false, |
|
42
|
|
|
'switch_pm_text' => false, |
|
43
|
|
|
'switch_pm_parameter' => false |
|
44
|
|
|
]; |
|
45
|
|
|
|
|
46
|
|
|
/** |
|
47
|
|
|
* Returns the id of query. |
|
48
|
|
|
* |
|
49
|
|
|
* @return string |
|
50
|
|
|
*/ |
|
51
|
|
|
public function getInlineQueryId() |
|
52
|
|
|
{ |
|
53
|
|
|
return $this->inline_query_id; |
|
54
|
|
|
} |
|
55
|
|
|
|
|
56
|
|
|
/** |
|
57
|
|
|
* Sets inline query id. |
|
58
|
|
|
* |
|
59
|
|
|
* @param string $inline_query_id |
|
60
|
|
|
* |
|
61
|
|
|
* @return $this |
|
62
|
|
|
*/ |
|
63
|
|
|
public function setInlineQueryId($inline_query_id) |
|
64
|
|
|
{ |
|
65
|
|
|
$this->inline_query_id = $inline_query_id; |
|
66
|
|
|
|
|
67
|
|
|
return $this; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
/** |
|
71
|
|
|
* Returns result. |
|
72
|
|
|
* |
|
73
|
|
|
* @return mixed |
|
74
|
|
|
*/ |
|
75
|
|
|
public function getResults() |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->results; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* Sets result |
|
82
|
|
|
* |
|
83
|
|
|
* @param mixed $results |
|
84
|
|
|
* |
|
85
|
|
|
* @return $this |
|
86
|
|
|
*/ |
|
87
|
|
|
public function setResults($results) |
|
88
|
|
|
{ |
|
89
|
|
|
$this->results = $results; |
|
90
|
|
|
|
|
91
|
|
|
return $this; |
|
92
|
|
|
} |
|
93
|
|
|
|
|
94
|
|
|
/** |
|
95
|
|
|
* Returns cache time. |
|
96
|
|
|
* |
|
97
|
|
|
* @return mixed |
|
98
|
|
|
*/ |
|
99
|
|
|
public function getCacheTime() |
|
100
|
|
|
{ |
|
101
|
|
|
return $this->cache_time; |
|
102
|
|
|
} |
|
103
|
|
|
|
|
104
|
|
|
/** |
|
105
|
|
|
* Sets cache time. |
|
106
|
|
|
* |
|
107
|
|
|
* @param mixed $cache_time |
|
108
|
|
|
* |
|
109
|
|
|
* @return $this |
|
110
|
|
|
*/ |
|
111
|
|
|
public function setCacheTime($cache_time) |
|
112
|
|
|
{ |
|
113
|
|
|
$this->cache_time = $cache_time; |
|
114
|
|
|
|
|
115
|
|
|
return $this; |
|
116
|
|
|
} |
|
117
|
|
|
|
|
118
|
|
|
/** |
|
119
|
|
|
* Returns is personal flag. |
|
120
|
|
|
* |
|
121
|
|
|
* @return mixed |
|
122
|
|
|
*/ |
|
123
|
|
|
public function getIsPersonal() |
|
124
|
|
|
{ |
|
125
|
|
|
return $this->is_personal; |
|
126
|
|
|
} |
|
127
|
|
|
|
|
128
|
|
|
/** |
|
129
|
|
|
* Sets is personal flag |
|
130
|
|
|
* |
|
131
|
|
|
* @param mixed $is_personal |
|
132
|
|
|
* |
|
133
|
|
|
* @return $this |
|
134
|
|
|
*/ |
|
135
|
|
|
public function setIsPersonal($is_personal) |
|
136
|
|
|
{ |
|
137
|
|
|
$this->is_personal = $is_personal; |
|
138
|
|
|
|
|
139
|
|
|
return $this; |
|
140
|
|
|
} |
|
141
|
|
|
|
|
142
|
|
|
/** |
|
143
|
|
|
* Returns next offset. |
|
144
|
|
|
* |
|
145
|
|
|
* @return mixed |
|
146
|
|
|
*/ |
|
147
|
|
|
public function getNextOffset() |
|
148
|
|
|
{ |
|
149
|
|
|
return $this->next_offset; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
/** |
|
153
|
|
|
* Sets next offset. |
|
154
|
|
|
* |
|
155
|
|
|
* @param mixed $next_offset |
|
156
|
|
|
* |
|
157
|
|
|
* @return $this |
|
158
|
|
|
*/ |
|
159
|
|
|
public function setNextOffset($next_offset) |
|
160
|
|
|
{ |
|
161
|
|
|
$this->next_offset = $next_offset; |
|
162
|
|
|
|
|
163
|
|
|
return $this; |
|
164
|
|
|
} |
|
165
|
|
|
|
|
166
|
|
|
/** |
|
167
|
|
|
* @return mixed |
|
168
|
|
|
*/ |
|
169
|
|
|
public function getSwitchPmText() |
|
170
|
|
|
{ |
|
171
|
|
|
return $this->switch_pm_text; |
|
172
|
|
|
} |
|
173
|
|
|
|
|
174
|
|
|
/** |
|
175
|
|
|
* @param mixed $switch_pm_text |
|
176
|
|
|
* |
|
177
|
|
|
* @return $this |
|
178
|
|
|
*/ |
|
179
|
|
|
public function setSwitchPmText($switch_pm_text) |
|
180
|
|
|
{ |
|
181
|
|
|
$this->switch_pm_text = $switch_pm_text; |
|
182
|
|
|
|
|
183
|
|
|
return $this; |
|
184
|
|
|
} |
|
185
|
|
|
|
|
186
|
|
|
/** |
|
187
|
|
|
* @return mixed |
|
188
|
|
|
*/ |
|
189
|
|
|
public function getSwitchPmParameter() |
|
190
|
|
|
{ |
|
191
|
|
|
return $this->switch_pm_parameter; |
|
192
|
|
|
} |
|
193
|
|
|
|
|
194
|
|
|
/** |
|
195
|
|
|
* @param mixed $switch_pm_parameter |
|
196
|
|
|
* |
|
197
|
|
|
* @return $this |
|
198
|
|
|
*/ |
|
199
|
|
|
public function setSwitchPmParameter($switch_pm_parameter) |
|
200
|
|
|
{ |
|
201
|
|
|
$this->switch_pm_parameter = $switch_pm_parameter; |
|
202
|
|
|
|
|
203
|
|
|
return $this; |
|
204
|
|
|
} |
|
205
|
|
|
} |
|
206
|
|
|
|