1 | <?php |
||
7 | class Reply extends Hash |
||
8 | { |
||
9 | protected $required = ['text']; |
||
10 | protected $defaults = ['text' => '']; |
||
11 | |||
12 | /** |
||
13 | * @param mixed $data |
||
14 | */ |
||
15 | 17 | public function __construct($data = []) |
|
16 | { |
||
17 | 17 | if (!is_array($data) && !empty($data)) { |
|
18 | 1 | $data = ['text' => $data]; |
|
19 | } |
||
20 | |||
21 | 17 | parent::__construct($data); |
|
22 | 17 | } |
|
23 | |||
24 | /** |
||
25 | * Returns only the text value. |
||
26 | * |
||
27 | * @return array |
||
28 | */ |
||
29 | 4 | public function toArray() |
|
33 | } |
||
34 |