1 | <?php |
||
7 | abstract class AbstractButton implements \JsonSerializable |
||
8 | { |
||
9 | |||
10 | use ValidatorTrait; |
||
11 | |||
12 | const TYPE_POSTBACK = 'postback'; |
||
13 | const TYPE_PHONE_NUMBER = 'phone_number'; |
||
14 | const TYPE_WEB_URL = 'web_url'; |
||
15 | const TYPE_SHARE = 'element_share'; |
||
16 | const TYPE_PAYMENT = 'payment'; |
||
17 | const TYPE_ACCOUNT_LINK = 'account_link'; |
||
18 | const TYPE_ACCOUNT_UNLINK = 'account_unlink'; |
||
19 | const TYPE_NESTED = 'nested'; |
||
20 | |||
21 | /** |
||
22 | * @var string |
||
23 | */ |
||
24 | private $type; |
||
25 | |||
26 | /** |
||
27 | * AbstractButton constructor. |
||
28 | * |
||
29 | * @param string $type |
||
30 | */ |
||
31 | 18 | public function __construct(string $type) |
|
35 | |||
36 | /** |
||
37 | * @return string |
||
38 | */ |
||
39 | 6 | public function getType(): string |
|
43 | |||
44 | /** |
||
45 | * @return array |
||
46 | */ |
||
47 | 14 | public function jsonSerialize(): array |
|
53 | } |
||
54 |