diff options
Diffstat (limited to 'src/Wallabag/CoreBundle/Notifications/Action.php')
-rw-r--r-- | src/Wallabag/CoreBundle/Notifications/Action.php | 91 |
1 files changed, 91 insertions, 0 deletions
diff --git a/src/Wallabag/CoreBundle/Notifications/Action.php b/src/Wallabag/CoreBundle/Notifications/Action.php new file mode 100644 index 00000000..d032adf9 --- /dev/null +++ b/src/Wallabag/CoreBundle/Notifications/Action.php | |||
@@ -0,0 +1,91 @@ | |||
1 | <?php | ||
2 | |||
3 | namespace Wallabag\CoreBundle\Notifications; | ||
4 | |||
5 | class Action implements ActionInterface | ||
6 | { | ||
7 | /** | ||
8 | * @var string | ||
9 | */ | ||
10 | protected $label; | ||
11 | |||
12 | /** | ||
13 | * @var int | ||
14 | */ | ||
15 | protected $type; | ||
16 | |||
17 | const TYPE_OK = 1; | ||
18 | const TYPE_YES = 2; | ||
19 | const TYPE_NO = 3; | ||
20 | const TYPE_INFO = 4; | ||
21 | |||
22 | /** | ||
23 | * @var string | ||
24 | */ | ||
25 | protected $link; | ||
26 | |||
27 | /** | ||
28 | * @return string | ||
29 | */ | ||
30 | public function getLabel() | ||
31 | { | ||
32 | return $this->label; | ||
33 | } | ||
34 | |||
35 | /** | ||
36 | * @param string $label | ||
37 | * | ||
38 | * @return ActionInterface | ||
39 | */ | ||
40 | public function setLabel($label) | ||
41 | { | ||
42 | $this->label = $label; | ||
43 | |||
44 | return $this; | ||
45 | } | ||
46 | |||
47 | /** | ||
48 | * @return int | ||
49 | */ | ||
50 | public function getType() | ||
51 | { | ||
52 | return $this->type; | ||
53 | } | ||
54 | |||
55 | /** | ||
56 | * @param int $type | ||
57 | * | ||
58 | * @return ActionInterface | ||
59 | * | ||
60 | * @throws \InvalidArgumentException | ||
61 | */ | ||
62 | public function setType($type) | ||
63 | { | ||
64 | if ($type <= 0 || $type > 4) { | ||
65 | throw new \InvalidArgumentException('The given type option is invalid'); | ||
66 | } | ||
67 | $this->type = $type; | ||
68 | |||
69 | return $this; | ||
70 | } | ||
71 | |||
72 | /** | ||
73 | * @return string | ||
74 | */ | ||
75 | public function getLink() | ||
76 | { | ||
77 | return $this->link; | ||
78 | } | ||
79 | |||
80 | /** | ||
81 | * @param string $link | ||
82 | * | ||
83 | * @return ActionInterface | ||
84 | */ | ||
85 | public function setLink($link) | ||
86 | { | ||
87 | $this->link = $link; | ||
88 | |||
89 | return $this; | ||
90 | } | ||
91 | } | ||