1 | <?php |
||
8 | class MessageEntity extends AbstractEntity |
||
9 | { |
||
10 | const ENTITY_TYPE = 'MessageEntity'; |
||
11 | |||
12 | const ENTITY_TYPE_COMMAND = 'Command'; |
||
13 | |||
14 | const ENTITY_TYPE_HASHTAG = 'Hashtag'; |
||
15 | |||
16 | const ENTITY_TYPE_MENTION = 'Mention'; |
||
17 | |||
18 | const ENTITY_TYPE_EMAIL = 'Email'; |
||
19 | |||
20 | const TYPE_MENTION = 'mention'; |
||
21 | |||
22 | const TYPE_HASHTAG = 'hashtag'; |
||
23 | |||
24 | const TYPE_BOT_COMMAND = 'bot_command'; |
||
25 | |||
26 | const TYPE_URL = 'url'; |
||
27 | |||
28 | const TYPE_EMAIL = 'email'; |
||
29 | |||
30 | const TYPE_BOLD = 'bold'; |
||
31 | |||
32 | const TYPE_ITALIC = 'italic'; |
||
33 | |||
34 | const TYPE_CODE = 'code'; |
||
35 | |||
36 | const TYPE_PRE = 'pre'; |
||
37 | |||
38 | const TYPE_TEXT_LINK = 'text_link'; |
||
39 | |||
40 | protected $source; |
||
41 | |||
42 | protected $args; |
||
43 | |||
44 | protected $type; |
||
45 | |||
46 | protected $offset = 0; |
||
47 | |||
48 | protected $length = 0; |
||
49 | |||
50 | protected $url; |
||
51 | |||
52 | protected $next = null; |
||
53 | |||
54 | public function __construct(array $data = []) |
||
60 | |||
61 | public function getEntityType() |
||
82 | |||
83 | public function isCommand() |
||
87 | |||
88 | public function isHashtag() |
||
92 | |||
93 | protected function parseSource() |
||
105 | |||
106 | /** |
||
107 | * @return mixed |
||
108 | */ |
||
109 | public function getSource() |
||
113 | |||
114 | /** |
||
115 | * @return mixed |
||
116 | */ |
||
117 | public function getType() |
||
121 | |||
122 | /** |
||
123 | * @return int |
||
124 | */ |
||
125 | public function getOffset() |
||
129 | |||
130 | /** |
||
131 | * @return int |
||
132 | */ |
||
133 | public function getLength() |
||
137 | |||
138 | /** |
||
139 | * @return mixed |
||
140 | */ |
||
141 | public function getUrl() |
||
145 | |||
146 | public function getCommand() |
||
154 | |||
155 | public function getHashtag() |
||
163 | |||
164 | public function getArgs() |
||
168 | |||
169 | /** |
||
170 | * @return null |
||
171 | */ |
||
172 | public function getNext() |
||
176 | |||
177 | /** |
||
178 | * @param null $next |
||
179 | */ |
||
180 | public function setNext($next) |
||
184 | } |
||
185 |