aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Notifications/Action.php
diff options
context:
space:
mode:
Diffstat (limited to 'src/Wallabag/CoreBundle/Notifications/Action.php')
-rw-r--r--src/Wallabag/CoreBundle/Notifications/Action.php84
1 files changed, 84 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..8ef1860a
--- /dev/null
+++ b/src/Wallabag/CoreBundle/Notifications/Action.php
@@ -0,0 +1,84 @@
1<?php
2
3namespace Wallabag\CoreBundle\Notifications;
4
5class 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 * @return ActionInterface
38 */
39 public function setLabel($label)
40 {
41 $this->label = $label;
42 return $this;
43 }
44
45 /**
46 * @return int
47 */
48 public function getType()
49 {
50 return $this->type;
51 }
52
53 /**
54 * @param int $type
55 * @return ActionInterface
56 * @throws \InvalidArgumentException
57 */
58 public function setType($type)
59 {
60 if ($type <= 0 || $type > 4) {
61 throw new \InvalidArgumentException('The given type option is invalid');
62 }
63 $this->type = $type;
64 return $this;
65 }
66
67 /**
68 * @return string
69 */
70 public function getLink()
71 {
72 return $this->link;
73 }
74
75 /**
76 * @param string $link
77 * @return ActionInterface
78 */
79 public function setLink($link)
80 {
81 $this->link = $link;
82 return $this;
83 }
84}