1 | <?php |
||
5 | class Notification |
||
6 | { |
||
7 | /** |
||
8 | * @var string |
||
9 | */ |
||
10 | private $type; |
||
11 | |||
12 | /** |
||
13 | * @var string |
||
14 | */ |
||
15 | private $message; |
||
16 | |||
17 | /** |
||
18 | * @param string $type |
||
19 | * @param string $message |
||
20 | */ |
||
21 | 48 | public function __construct($type, $message) |
|
26 | |||
27 | /** |
||
28 | * @param array $data |
||
29 | * @return Notification |
||
30 | */ |
||
31 | 6 | public static function fromArray(array $data) |
|
38 | |||
39 | /** |
||
40 | * @param string $message |
||
41 | * @return Notification |
||
42 | */ |
||
43 | 27 | public static function success($message) |
|
47 | |||
48 | /** |
||
49 | * @param string $message |
||
50 | * @return Notification |
||
51 | */ |
||
52 | 18 | public static function error($message) |
|
56 | |||
57 | /** |
||
58 | * @param string $message |
||
59 | * @return Notification |
||
60 | */ |
||
61 | 9 | public static function warning($message) |
|
65 | |||
66 | /** |
||
67 | * @param string $message |
||
68 | * @return Notification |
||
69 | */ |
||
70 | 9 | public static function info($message) |
|
74 | |||
75 | /** |
||
76 | * @return string |
||
77 | */ |
||
78 | 30 | public function getType() |
|
82 | |||
83 | /** |
||
84 | * @return string |
||
85 | */ |
||
86 | 30 | public function getMessage() |
|
90 | } |
||
91 |