1 | <?php |
||
7 | class AttachmentAction |
||
8 | { |
||
9 | const TYPE_BUTTON = 'button'; |
||
10 | |||
11 | const STYLE_DEFAULT = 'default'; |
||
12 | const STYLE_PRIMARY = 'primary'; |
||
13 | const STYLE_DANGER = 'danger'; |
||
14 | |||
15 | /** |
||
16 | * The required name field of the action. The name will be returned to your Action URL. |
||
17 | * |
||
18 | * @var string |
||
19 | */ |
||
20 | protected $name; |
||
21 | |||
22 | /** |
||
23 | * The required label for the action. |
||
24 | * |
||
25 | * @var string |
||
26 | */ |
||
27 | protected $text; |
||
28 | |||
29 | /** |
||
30 | * Button style. |
||
31 | * |
||
32 | * @var string |
||
33 | */ |
||
34 | protected $style; |
||
35 | |||
36 | /** |
||
37 | * The required type of the action. |
||
38 | * |
||
39 | * @var string |
||
40 | */ |
||
41 | protected $type = self::TYPE_BUTTON; |
||
42 | |||
43 | /** |
||
44 | * Optional value. It will be sent to your Action URL. |
||
45 | * |
||
46 | * @var string |
||
47 | */ |
||
48 | protected $value; |
||
49 | |||
50 | /** |
||
51 | * Confirmation field. |
||
52 | * |
||
53 | * @var ActionConfirmation |
||
54 | */ |
||
55 | protected $confirm; |
||
56 | |||
57 | /** |
||
58 | * Instantiate a new AttachmentAction. |
||
59 | * |
||
60 | * @param array $attributes |
||
61 | * @return void |
||
|
|||
62 | */ |
||
63 | public function __construct(array $attributes) |
||
89 | |||
90 | /** |
||
91 | * @return string |
||
92 | */ |
||
93 | public function getName() |
||
97 | |||
98 | /** |
||
99 | * @param string $name |
||
100 | * @return AttachmentAction |
||
101 | */ |
||
102 | public function setName($name) |
||
108 | |||
109 | /** |
||
110 | * @return string |
||
111 | */ |
||
112 | public function getText() |
||
116 | |||
117 | /** |
||
118 | * @param string $text |
||
119 | * @return AttachmentAction |
||
120 | */ |
||
121 | public function setText($text) |
||
127 | |||
128 | /** |
||
129 | * @return string |
||
130 | */ |
||
131 | public function getStyle() |
||
135 | |||
136 | /** |
||
137 | * @param string $style |
||
138 | * @return AttachmentAction |
||
139 | */ |
||
140 | public function setStyle($style) |
||
146 | |||
147 | /** |
||
148 | * @return string |
||
149 | */ |
||
150 | public function getType() |
||
154 | |||
155 | /** |
||
156 | * @param string $type |
||
157 | * @return AttachmentAction |
||
158 | */ |
||
159 | public function setType($type) |
||
165 | |||
166 | /** |
||
167 | * @return string |
||
168 | */ |
||
169 | public function getValue() |
||
173 | |||
174 | /** |
||
175 | * @param string $value |
||
176 | * @return AttachmentAction |
||
177 | */ |
||
178 | public function setValue($value) |
||
184 | |||
185 | /** |
||
186 | * @return ActionConfirmation |
||
187 | */ |
||
188 | public function getConfirm() |
||
192 | |||
193 | /** |
||
194 | * @param ActionConfirmation|array $confirm |
||
195 | * @return AttachmentAction |
||
196 | */ |
||
197 | public function setConfirm($confirm) |
||
211 | |||
212 | /** |
||
213 | * Get the array representation of this attachment action. |
||
214 | * |
||
215 | * @return array |
||
216 | */ |
||
217 | public function toArray() |
||
228 | } |
||
229 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.