1 | 2 | simandl | <?php |
2 | | | |
3 | | | namespace FreenetRouter\Models\UI; |
4 | | | |
5 | | | use Phem\Core\Object; |
6 | | | use Phem\Environment\EnvironmentManager; |
7 | | | |
8 | | | /** |
9 | | | * @author Jakub PetrĹžĂlka <kubapet@lbcfree.net> |
10 | | | */ |
11 | | | class MenuEntry extends Object |
12 | | | { |
13 | | | private $controller; |
14 | | | private $task; |
15 | | | private $title; |
16 | | | |
17 | | | function __construct($controller, $task, $title) |
18 | | | { |
19 | | | $this->controller = $controller; |
20 | | | $this->task = $task; |
21 | | | $this->title = $title; |
22 | | | } |
23 | | | |
24 | | | public function getController() |
25 | | | { |
26 | | | return $this->controller; |
27 | | | } |
28 | | | |
29 | | | public function getTask() |
30 | | | { |
31 | | | return $this->task; |
32 | | | } |
33 | | | |
34 | | | public function getTitle() |
35 | | | { |
36 | | | return $this->title; |
37 | | | } |
38 | | | |
39 | | | public function setController($controller) |
40 | | | { |
41 | | | $this->controller = $controller; |
42 | | | } |
43 | | | |
44 | | | public function setTask($task) |
45 | | | { |
46 | | | $this->task = $task; |
47 | | | } |
48 | | | |
49 | | | public function setTitle($title) |
50 | | | { |
51 | | | $this->title = $title; |
52 | | | } |
53 | | | |
54 | | | public function getUrl() |
55 | | | { |
56 | | | $lb = EnvironmentManager::getLinkBuilder(); |
57 | | | return $lb->navigate($this->controller, $this->task); |
58 | | | } |
59 | | | } |