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