1
|
|
|
<?php |
2
|
|
|
/** |
3
|
|
|
* Message.php |
4
|
|
|
* |
5
|
|
|
* @copyright More in license.md |
6
|
|
|
* @license https://www.ipublikuj.eu |
7
|
|
|
* @author Adam Kadlec <[email protected]> |
8
|
|
|
* @package iPublikuj:FlashMessages! |
9
|
|
|
* @subpackage Entities |
10
|
|
|
* @since 1.0.0 |
11
|
|
|
* |
12
|
|
|
* @date 06.02.15 |
13
|
|
|
*/ |
14
|
|
|
|
15
|
|
|
declare(strict_types = 1); |
16
|
|
|
|
17
|
|
|
namespace IPub\FlashMessages\Entities; |
18
|
|
|
|
19
|
|
|
use IPub\FlashMessages\Exceptions; |
20
|
|
|
|
21
|
|
|
/** |
22
|
|
|
* Flash message entity interface |
23
|
|
|
* |
24
|
|
|
* @package iPublikuj:FlashMessages! |
25
|
|
|
* @subpackage Entities |
26
|
|
|
* |
27
|
|
|
* @author Adam Kadlec <[email protected]> |
28
|
|
|
*/ |
29
|
1 |
|
interface IMessage |
30
|
|
|
{ |
31
|
|
|
public const LEVEL_INFO = 'info'; |
32
|
|
|
public const LEVEL_SUCCESS = 'success'; |
33
|
|
|
public const LEVEL_WARNING = 'warning'; |
34
|
|
|
public const LEVEL_ERROR = 'error'; |
35
|
|
|
|
36
|
|
|
/** |
37
|
|
|
* @param string $message |
38
|
|
|
* |
39
|
|
|
* @return void |
40
|
|
|
*/ |
41
|
|
|
public function setMessage(string $message) : void; |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @return string |
45
|
|
|
*/ |
46
|
|
|
public function getMessage() : string; |
47
|
|
|
|
48
|
|
|
/** |
49
|
|
|
* @param string $level |
50
|
|
|
* |
51
|
|
|
* @return void |
52
|
|
|
*/ |
53
|
|
|
public function setLevel(string $level) : void; |
54
|
|
|
|
55
|
|
|
/** |
56
|
|
|
* @return string |
57
|
|
|
*/ |
58
|
|
|
public function getLevel() : string; |
59
|
|
|
|
60
|
|
|
/** |
61
|
|
|
* @return void |
62
|
|
|
*/ |
63
|
|
|
public function info() : void; |
64
|
|
|
|
65
|
|
|
/** |
66
|
|
|
* @return void |
67
|
|
|
*/ |
68
|
|
|
public function success() : void; |
69
|
|
|
|
70
|
|
|
/** |
71
|
|
|
* @return void |
72
|
|
|
*/ |
73
|
|
|
public function warning() : void; |
74
|
|
|
|
75
|
|
|
/** |
76
|
|
|
* @return void |
77
|
|
|
*/ |
78
|
|
|
public function error() : void; |
79
|
|
|
|
80
|
|
|
/** |
81
|
|
|
* @param string|NULL $title |
82
|
|
|
* |
83
|
|
|
* @return void |
84
|
|
|
*/ |
85
|
|
|
public function setTitle(string $title = NULL) : void; |
86
|
|
|
|
87
|
|
|
/** |
88
|
|
|
* @return string|NULL |
89
|
|
|
*/ |
90
|
|
|
public function getTitle() : ?string; |
91
|
|
|
|
92
|
|
|
/** |
93
|
|
|
* @param bool $overlay |
94
|
|
|
* |
95
|
|
|
* @return void |
96
|
|
|
*/ |
97
|
|
|
public function setOverlay(bool $overlay) : void; |
98
|
|
|
|
99
|
|
|
/** |
100
|
|
|
* @return bool |
101
|
|
|
*/ |
102
|
|
|
public function hasOverlay() : bool; |
103
|
|
|
|
104
|
|
|
/** |
105
|
|
|
* @param array $parameter |
106
|
|
|
* |
107
|
|
|
* @return void |
108
|
|
|
* |
109
|
|
|
* @throws Exceptions\InvalidStateException when object is unserialized |
110
|
|
|
*/ |
111
|
|
|
public function setParameters(array $parameter) : void; |
112
|
|
|
|
113
|
|
|
/** |
114
|
|
|
* @param int $count |
115
|
|
|
* |
116
|
|
|
* @return void |
117
|
|
|
* |
118
|
|
|
* @throws Exceptions\InvalidStateException when object is unserialized |
119
|
|
|
*/ |
120
|
|
|
public function setCount(int $count) : void; |
121
|
|
|
|
122
|
|
|
/** |
123
|
|
|
* @param bool $displayed |
124
|
|
|
* |
125
|
|
|
* @return void |
126
|
|
|
*/ |
127
|
|
|
public function setDisplayed(bool $displayed = TRUE) : void; |
128
|
|
|
|
129
|
|
|
/** |
130
|
|
|
* @return bool |
131
|
|
|
*/ |
132
|
|
|
public function isDisplayed() : bool; |
133
|
|
|
} |
134
|
|
|
|