1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class InlineQueryResultPhoto |
7
|
|
|
* Represents a link to a photo. By default, this photo will be sent by the user with optional caption. |
8
|
|
|
* Alternatively, you can provide message_text to send it instead of photo. |
9
|
|
|
* |
10
|
|
|
* @package TelegramBot\Api\Types\Inline |
11
|
|
|
*/ |
12
|
|
|
class InlineQueryResultPhoto extends AbstractInlineQueryResult |
13
|
|
|
{ |
14
|
|
|
/** |
15
|
|
|
* {@inheritdoc} |
16
|
|
|
* |
17
|
|
|
* @var array |
18
|
|
|
*/ |
19
|
|
|
static protected $requiredParams = ['type', 'id', 'photo_url', 'thumb_url']; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* {@inheritdoc} |
23
|
|
|
* |
24
|
|
|
* @var array |
25
|
|
|
*/ |
26
|
|
|
static protected $map = [ |
27
|
|
|
'type' => true, |
28
|
|
|
'id' => true, |
29
|
|
|
'photo_url' => true, |
30
|
|
|
'mime_type' => true, |
31
|
|
|
'photo_width' => true, |
32
|
|
|
'photo_height' => true, |
33
|
|
|
'thumb_url' => true, |
34
|
|
|
'title' => true, |
35
|
|
|
'description' => true, |
36
|
|
|
'caption' => true, |
37
|
|
|
'message_text' => true, |
38
|
|
|
'parse_mode' => true, |
39
|
|
|
'disable_web_page_preview' => true |
40
|
|
|
]; |
41
|
|
|
|
42
|
|
|
/** |
43
|
|
|
* A valid URL of the photo. Photo size must not exceed 5MB |
44
|
|
|
* |
45
|
|
|
* @var string |
46
|
|
|
*/ |
47
|
|
|
protected $photoUrl; |
48
|
|
|
|
49
|
|
|
/** |
50
|
|
|
* Optional. MIME type of the photo, defaults to image/jpeg |
51
|
|
|
* |
52
|
|
|
* @var string |
53
|
|
|
*/ |
54
|
|
|
protected $mimeType; |
55
|
|
|
|
56
|
|
|
/** |
57
|
|
|
* Optional. Width of the photo |
58
|
|
|
* |
59
|
|
|
* @var int |
60
|
|
|
*/ |
61
|
|
|
protected $photoWidth; |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* Optional. Height of the photo |
65
|
|
|
* |
66
|
|
|
* @var int |
67
|
|
|
*/ |
68
|
|
|
protected $photoHeight; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* URL of the thumbnail for the photo |
72
|
|
|
* |
73
|
|
|
* @var |
74
|
|
|
*/ |
75
|
|
|
protected $thumbUrl; |
76
|
|
|
|
77
|
|
|
/** |
78
|
|
|
* Optional. Short description of the result |
79
|
|
|
* |
80
|
|
|
* @var string |
81
|
|
|
*/ |
82
|
|
|
protected $description; |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* Optional. Caption of the photo to be sent, 0-200 characters |
86
|
|
|
* |
87
|
|
|
* @var string |
88
|
|
|
*/ |
89
|
|
|
protected $caption; |
90
|
|
|
|
91
|
|
|
/** |
92
|
|
|
* @return string |
93
|
|
|
*/ |
94
|
|
|
public function getPhotoUrl() |
95
|
|
|
{ |
96
|
|
|
return $this->photoUrl; |
97
|
|
|
} |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @param string $photoUrl |
101
|
|
|
*/ |
102
|
|
|
public function setPhotoUrl($photoUrl) |
103
|
|
|
{ |
104
|
|
|
$this->photoUrl = $photoUrl; |
105
|
|
|
} |
106
|
|
|
|
107
|
|
|
/** |
108
|
|
|
* @return string |
109
|
|
|
*/ |
110
|
|
|
public function getMimeType() |
111
|
|
|
{ |
112
|
|
|
return $this->mimeType; |
113
|
|
|
} |
114
|
|
|
|
115
|
|
|
/** |
116
|
|
|
* @param string $mimeType |
117
|
|
|
*/ |
118
|
|
|
public function setMimeType($mimeType) |
119
|
|
|
{ |
120
|
|
|
$this->mimeType = $mimeType; |
121
|
|
|
} |
122
|
|
|
|
123
|
|
|
/** |
124
|
|
|
* @return int |
125
|
|
|
*/ |
126
|
|
|
public function getPhotoWidth() |
127
|
|
|
{ |
128
|
|
|
return $this->photoWidth; |
129
|
|
|
} |
130
|
|
|
|
131
|
|
|
/** |
132
|
|
|
* @param int $photoWidth |
133
|
|
|
*/ |
134
|
|
|
public function setPhotoWidth($photoWidth) |
135
|
|
|
{ |
136
|
|
|
$this->photoWidth = $photoWidth; |
137
|
|
|
} |
138
|
|
|
|
139
|
|
|
/** |
140
|
|
|
* @return int |
141
|
|
|
*/ |
142
|
|
|
public function getPhotoHeight() |
143
|
|
|
{ |
144
|
|
|
return $this->photoHeight; |
145
|
|
|
} |
146
|
|
|
|
147
|
|
|
/** |
148
|
|
|
* @param int $photoHeight |
149
|
|
|
*/ |
150
|
|
|
public function setPhotoHeight($photoHeight) |
151
|
|
|
{ |
152
|
|
|
$this->photoHeight = $photoHeight; |
153
|
|
|
} |
154
|
|
|
|
155
|
|
|
/** |
156
|
|
|
* @return mixed |
157
|
|
|
*/ |
158
|
|
|
public function getThumbUrl() |
159
|
|
|
{ |
160
|
|
|
return $this->thumbUrl; |
161
|
|
|
} |
162
|
|
|
|
163
|
|
|
/** |
164
|
|
|
* @param mixed $thumbUrl |
165
|
|
|
*/ |
166
|
|
|
public function setThumbUrl($thumbUrl) |
167
|
|
|
{ |
168
|
|
|
$this->thumbUrl = $thumbUrl; |
169
|
|
|
} |
170
|
|
|
|
171
|
|
|
/** |
172
|
|
|
* @return string |
173
|
|
|
*/ |
174
|
|
|
public function getDescription() |
175
|
|
|
{ |
176
|
|
|
return $this->description; |
177
|
|
|
} |
178
|
|
|
|
179
|
|
|
/** |
180
|
|
|
* @param string $description |
181
|
|
|
*/ |
182
|
|
|
public function setDescription($description) |
183
|
|
|
{ |
184
|
|
|
$this->description = $description; |
185
|
|
|
} |
186
|
|
|
|
187
|
|
|
/** |
188
|
|
|
* @return string |
189
|
|
|
*/ |
190
|
|
|
public function getCaption() |
191
|
|
|
{ |
192
|
|
|
return $this->caption; |
193
|
|
|
} |
194
|
|
|
|
195
|
|
|
/** |
196
|
|
|
* @param string $caption |
197
|
|
|
*/ |
198
|
|
|
public function setCaption($caption) |
199
|
|
|
{ |
200
|
|
|
$this->caption = $caption; |
201
|
|
|
} |
202
|
|
|
} |
203
|
|
|
|