1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
namespace TelegramBot\Api\Types\Inline\QueryResult; |
4
|
|
|
|
5
|
|
|
use TelegramBot\Api\BaseType; |
6
|
|
|
use TelegramBot\Api\Types\Inline\InlineKeyboardMarkup; |
7
|
|
|
use TelegramBot\Api\Types\Inline\InputMessageContent; |
8
|
|
|
|
9
|
|
|
/** |
10
|
|
|
* Class AbstractInlineQueryResult |
11
|
|
|
* Abstract class for representing one result of an inline query |
12
|
|
|
* |
13
|
|
|
* @package TelegramBot\Api\Types |
14
|
|
|
*/ |
15
|
|
|
class AbstractInlineQueryResult extends BaseType |
16
|
|
|
{ |
17
|
|
|
/** |
18
|
|
|
* Type of the result, must be one of: article, photo, gif, mpeg4_gif, video |
19
|
|
|
* |
20
|
|
|
* @var string |
21
|
|
|
*/ |
22
|
|
|
protected $type; |
23
|
|
|
|
24
|
|
|
/** |
25
|
|
|
* Unique identifier for this result, 1-64 bytes |
26
|
|
|
* |
27
|
|
|
* @var string |
28
|
|
|
*/ |
29
|
|
|
protected $id; |
30
|
|
|
|
31
|
|
|
/** |
32
|
|
|
* Title for the result |
33
|
|
|
* |
34
|
|
|
* @var string |
35
|
|
|
*/ |
36
|
|
|
protected $title; |
37
|
|
|
|
38
|
|
|
/** |
39
|
|
|
* Content of the message to be sent instead of the file |
40
|
|
|
* |
41
|
|
|
* @var InputMessageContent |
42
|
|
|
*/ |
43
|
|
|
protected $inputMessageContent; |
44
|
|
|
|
45
|
|
|
/** |
46
|
|
|
* Optional. Inline keyboard attached to the message |
47
|
|
|
* |
48
|
|
|
* @var InlineKeyboardMarkup |
49
|
|
|
*/ |
50
|
|
|
protected $replyMarkup; |
51
|
|
|
|
52
|
|
|
/** |
53
|
|
|
* AbstractInlineQueryResult constructor. |
54
|
|
|
* |
55
|
|
|
* @param string $id |
56
|
|
|
* @param string $title |
57
|
|
|
* @param InputMessageContent|null $inputMessageContent |
58
|
|
|
* @param InlineKeyboardMarkup|null $replyMarkup |
59
|
|
|
*/ |
60
|
|
|
public function __construct($id, $title, $inputMessageContent = null, $replyMarkup = null) |
61
|
|
|
{ |
62
|
|
|
$this->id = $id; |
63
|
|
|
$this->title = $title; |
64
|
|
|
$this->inputMessageContent = $inputMessageContent; |
65
|
|
|
$this->replyMarkup = $replyMarkup; |
66
|
|
|
} |
67
|
|
|
|
68
|
|
|
/** |
69
|
|
|
* @return string |
70
|
|
|
*/ |
71
|
|
|
public function getType() |
72
|
|
|
{ |
73
|
|
|
return $this->type; |
74
|
|
|
} |
75
|
|
|
|
76
|
|
|
/** |
77
|
|
|
* @param string $type |
78
|
|
|
*/ |
79
|
|
|
public function setType($type) |
80
|
|
|
{ |
81
|
|
|
$this->type = $type; |
82
|
|
|
} |
83
|
|
|
|
84
|
|
|
/** |
85
|
|
|
* @return string |
86
|
|
|
*/ |
87
|
|
|
public function getId() |
88
|
|
|
{ |
89
|
|
|
return $this->id; |
90
|
|
|
} |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param string $id |
94
|
|
|
*/ |
95
|
|
|
public function setId($id) |
96
|
|
|
{ |
97
|
|
|
$this->id = $id; |
98
|
|
|
} |
99
|
|
|
|
100
|
|
|
/** |
101
|
|
|
* @return string |
102
|
|
|
*/ |
103
|
|
|
public function getTitle() |
104
|
|
|
{ |
105
|
|
|
return $this->title; |
106
|
|
|
} |
107
|
|
|
|
108
|
|
|
/** |
109
|
|
|
* @param string $title |
110
|
|
|
*/ |
111
|
|
|
public function setTitle($title) |
112
|
|
|
{ |
113
|
|
|
$this->title = $title; |
114
|
|
|
} |
115
|
|
|
|
116
|
|
|
/** |
117
|
|
|
* @return InputMessageContent |
118
|
|
|
*/ |
119
|
|
|
public function getInputMessageContent() |
120
|
|
|
{ |
121
|
|
|
return $this->inputMessageContent; |
122
|
|
|
} |
123
|
|
|
|
124
|
|
|
/** |
125
|
|
|
* @param InputMessageContent $inputMessageContent |
126
|
|
|
*/ |
127
|
|
|
public function setInputMessageContent($inputMessageContent) |
128
|
|
|
{ |
129
|
|
|
$this->inputMessageContent = $inputMessageContent; |
130
|
|
|
} |
131
|
|
|
|
132
|
|
|
/** |
133
|
|
|
* @return InlineKeyboardMarkup |
134
|
|
|
*/ |
135
|
|
|
public function getReplyMarkup() |
136
|
|
|
{ |
137
|
|
|
return $this->replyMarkup; |
138
|
|
|
} |
139
|
|
|
|
140
|
|
|
/** |
141
|
|
|
* @param InlineKeyboardMarkup $replyMarkup |
142
|
|
|
*/ |
143
|
|
|
public function setReplyMarkup($replyMarkup) |
144
|
|
|
{ |
145
|
|
|
$this->replyMarkup = $replyMarkup; |
146
|
|
|
} |
147
|
|
|
} |
148
|
|
|
|