]>
Commit | Line | Data |
---|---|---|
22a4b20e TC |
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 | * @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 | } |