Total Complexity | 4 |
Total Lines | 67 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
20 | class ButtonsTemplate extends AbstractTemplate |
||
21 | { |
||
22 | use ActionTemplateTrait; |
||
23 | |||
24 | /** |
||
25 | * @var string |
||
26 | */ |
||
27 | public $altText = 'This is buttons template.'; |
||
28 | |||
29 | /** |
||
30 | * @var string |
||
31 | */ |
||
32 | public $title = 'Menu'; |
||
33 | |||
34 | /** |
||
35 | * @var string |
||
36 | */ |
||
37 | public $text = 'Please select'; |
||
38 | |||
39 | /** |
||
40 | * @var string |
||
41 | */ |
||
42 | public $thumbnail; |
||
43 | |||
44 | /** |
||
45 | * @var Action[] |
||
46 | */ |
||
47 | public $actions = []; |
||
48 | |||
49 | /** |
||
50 | * {@inheritdoc} |
||
51 | */ |
||
52 | public function getTemplate() |
||
53 | { |
||
54 | return new TemplateMessageBuilder($this->altText, new ButtonTemplateBuilder( |
||
55 | $this->title, |
||
56 | $this->text, |
||
57 | $this->thumbnail, |
||
58 | $this->createActions($this->actions) |
||
59 | )); |
||
60 | } |
||
61 | |||
62 | /** |
||
63 | * @param $label |
||
64 | * @param $text |
||
65 | */ |
||
66 | public function addMessageAction($label, $text) |
||
69 | } |
||
70 | |||
71 | /** |
||
72 | * @param $label |
||
73 | * @param $link |
||
74 | */ |
||
75 | public function addUriAction($label, $link) |
||
78 | } |
||
79 | |||
80 | /** |
||
81 | * @param $label |
||
82 | * @param $data |
||
83 | */ |
||
84 | public function addPostbackAction($label, $data) |
||
89 |