1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline; |
4
|
|
|
|
5
|
|
|
/** |
6
|
|
|
* Class InlineQueryResultArticle |
7
|
|
|
* Represents a link to an article or web page. |
8
|
|
|
* |
9
|
|
|
* @package TelegramBot\Api\Types\Inline |
10
|
|
|
*/ |
11
|
|
|
class InlineQueryResultArticle extends AbstractInlineQueryResult |
12
|
|
|
{ |
13
|
|
|
/** |
14
|
|
|
* {@inheritdoc} |
15
|
|
|
* |
16
|
|
|
* @var array |
17
|
|
|
*/ |
18
|
|
|
static protected $requiredParams = ['type', 'id', 'title', 'message_text']; |
19
|
|
|
|
20
|
|
|
/** |
21
|
|
|
* {@inheritdoc} |
22
|
|
|
* |
23
|
|
|
* @var array |
24
|
|
|
*/ |
25
|
|
|
static protected $map = [ |
26
|
|
|
'type' => true, |
27
|
|
|
'id' => true, |
28
|
|
|
'title' => true, |
29
|
|
|
'message_text' => true, |
30
|
|
|
'parse_mode' => true, |
31
|
|
|
'disable_web_page_preview' => true, |
32
|
|
|
'url' => true, |
33
|
|
|
'hide_url' => true, |
34
|
|
|
'description' => true, |
35
|
|
|
'thumb_url' => true, |
36
|
|
|
'thumb_width' => true, |
37
|
|
|
'thumb_height' => true |
38
|
|
|
]; |
39
|
|
|
|
40
|
|
|
/** |
41
|
|
|
* Optional. URL of the result |
42
|
|
|
* |
43
|
|
|
* @var string |
44
|
|
|
*/ |
45
|
|
|
protected $url; |
46
|
|
|
|
47
|
|
|
/** |
48
|
|
|
* Optional. Pass True, if you don't want the URL to be shown in the message |
49
|
|
|
* |
50
|
|
|
* @var bool |
51
|
|
|
*/ |
52
|
|
|
protected $hideUrl; |
53
|
|
|
|
54
|
|
|
/** |
55
|
|
|
* Optional. Short description of the result |
56
|
|
|
* |
57
|
|
|
* @var string |
58
|
|
|
*/ |
59
|
|
|
protected $description; |
60
|
|
|
|
61
|
|
|
/** |
62
|
|
|
* Optional. Url of the thumbnail for the result |
63
|
|
|
* |
64
|
|
|
* @var string |
65
|
|
|
*/ |
66
|
|
|
protected $thumbUrl; |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* Optional. Thumbnail width |
70
|
|
|
* |
71
|
|
|
* @var int |
72
|
|
|
*/ |
73
|
|
|
protected $thumbWidth; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* Optional. Thumbnail height |
77
|
|
|
* |
78
|
|
|
* @var int |
79
|
|
|
*/ |
80
|
|
|
protected $thumbHeight; |
81
|
|
|
|
82
|
|
|
/** |
83
|
|
|
* @return string |
84
|
|
|
*/ |
85
|
|
|
public function getUrl() |
86
|
|
|
{ |
87
|
|
|
return $this->url; |
88
|
|
|
} |
89
|
|
|
|
90
|
|
|
/** |
91
|
|
|
* @param string $url |
92
|
|
|
*/ |
93
|
|
|
public function setUrl($url) |
94
|
|
|
{ |
95
|
|
|
$this->url = $url; |
96
|
|
|
} |
97
|
|
|
|
98
|
|
|
/** |
99
|
|
|
* @return boolean |
100
|
|
|
*/ |
101
|
|
|
public function isHideUrl() |
102
|
|
|
{ |
103
|
|
|
return $this->hideUrl; |
104
|
|
|
} |
105
|
|
|
|
106
|
|
|
/** |
107
|
|
|
* @param boolean $hideUrl |
108
|
|
|
*/ |
109
|
|
|
public function setHideUrl($hideUrl) |
110
|
|
|
{ |
111
|
|
|
$this->hideUrl = $hideUrl; |
112
|
|
|
} |
113
|
|
|
|
114
|
|
|
/** |
115
|
|
|
* @return string |
116
|
|
|
*/ |
117
|
|
|
public function getDescription() |
118
|
|
|
{ |
119
|
|
|
return $this->description; |
120
|
|
|
} |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param string $description |
124
|
|
|
*/ |
125
|
|
|
public function setDescription($description) |
126
|
|
|
{ |
127
|
|
|
$this->description = $description; |
128
|
|
|
} |
129
|
|
|
|
130
|
|
|
/** |
131
|
|
|
* @return string |
132
|
|
|
*/ |
133
|
|
|
public function getThumbUrl() |
134
|
|
|
{ |
135
|
|
|
return $this->thumbUrl; |
136
|
|
|
} |
137
|
|
|
|
138
|
|
|
/** |
139
|
|
|
* @param string $thumbUrl |
140
|
|
|
*/ |
141
|
|
|
public function setThumbUrl($thumbUrl) |
142
|
|
|
{ |
143
|
|
|
$this->thumbUrl = $thumbUrl; |
144
|
|
|
} |
145
|
|
|
|
146
|
|
|
/** |
147
|
|
|
* @return int |
148
|
|
|
*/ |
149
|
|
|
public function getThumbWidth() |
150
|
|
|
{ |
151
|
|
|
return $this->thumbWidth; |
152
|
|
|
} |
153
|
|
|
|
154
|
|
|
/** |
155
|
|
|
* @param int $thumbWidth |
156
|
|
|
*/ |
157
|
|
|
public function setThumbWidth($thumbWidth) |
158
|
|
|
{ |
159
|
|
|
$this->thumbWidth = $thumbWidth; |
160
|
|
|
} |
161
|
|
|
|
162
|
|
|
/** |
163
|
|
|
* @return int |
164
|
|
|
*/ |
165
|
|
|
public function getThumbHeight() |
166
|
|
|
{ |
167
|
|
|
return $this->thumbHeight; |
168
|
|
|
} |
169
|
|
|
|
170
|
|
|
/** |
171
|
|
|
* @param int $thumbHeight |
172
|
|
|
*/ |
173
|
|
|
public function setThumbHeight($thumbHeight) |
174
|
|
|
{ |
175
|
|
|
$this->thumbHeight = $thumbHeight; |
176
|
|
|
} |
177
|
|
|
} |
178
|
|
|
|