]> git.immae.eu Git - github/wallabag/wallabag.git/blob - src/Wallabag/CoreBundle/Notifications/Action.php
First draft for notifications
[github/wallabag/wallabag.git] / src / Wallabag / CoreBundle / Notifications / Action.php
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 * @throws \InvalidArgumentException
60 */
61 public function setType($type)
62 {
63 if ($type <= 0 || $type > 4) {
64 throw new \InvalidArgumentException('The given type option is invalid');
65 }
66 $this->type = $type;
67
68 return $this;
69 }
70
71 /**
72 * @return string
73 */
74 public function getLink()
75 {
76 return $this->link;
77 }
78
79 /**
80 * @param string $link
81 *
82 * @return ActionInterface
83 */
84 public function setLink($link)
85 {
86 $this->link = $link;
87
88 return $this;
89 }
90 }