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 | /** |
||
59 | * Instantiate a new AttachmentAction. |
||
60 | * |
||
61 | * @param array $attributes |
||
62 | * @return void |
||
|
|||
63 | */ |
||
64 | public function __construct(array $attributes) |
||
90 | |||
91 | /** |
||
92 | * @return string |
||
93 | */ |
||
94 | public function getName() |
||
98 | |||
99 | /** |
||
100 | * @param string $name |
||
101 | * @return AttachmentAction |
||
102 | */ |
||
103 | public function setName($name) |
||
109 | |||
110 | /** |
||
111 | * @return string |
||
112 | */ |
||
113 | public function getText() |
||
117 | |||
118 | /** |
||
119 | * @param string $text |
||
120 | * @return AttachmentAction |
||
121 | */ |
||
122 | public function setText($text) |
||
128 | |||
129 | /** |
||
130 | * @return string |
||
131 | */ |
||
132 | public function getStyle() |
||
136 | |||
137 | /** |
||
138 | * @param string $style |
||
139 | * @return AttachmentAction |
||
140 | */ |
||
141 | public function setStyle($style) |
||
147 | |||
148 | /** |
||
149 | * @return string |
||
150 | */ |
||
151 | public function getType() |
||
155 | |||
156 | /** |
||
157 | * @param string $type |
||
158 | * @return AttachmentAction |
||
159 | */ |
||
160 | public function setType($type) |
||
166 | |||
167 | /** |
||
168 | * @return string |
||
169 | */ |
||
170 | public function getValue() |
||
174 | |||
175 | /** |
||
176 | * @param string $value |
||
177 | * @return AttachmentAction |
||
178 | */ |
||
179 | public function setValue($value) |
||
185 | |||
186 | /** |
||
187 | * @return ActionConfirmation |
||
188 | */ |
||
189 | public function getConfirm() |
||
193 | |||
194 | /** |
||
195 | * @param ActionConfirmation|array $confirm |
||
196 | * @return AttachmentAction |
||
197 | */ |
||
198 | public function setConfirm($confirm) |
||
212 | |||
213 | /** |
||
214 | * Get the array representation of this attachment action. |
||
215 | * |
||
216 | * @return array |
||
217 | */ |
||
218 | public function toArray() |
||
229 | } |
||
230 |
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.