|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace App\Presenters; |
|
4
|
|
|
|
|
5
|
|
|
use App\Models\MeetingModel; |
|
6
|
|
|
use App\Components\ProgramOverviewControl; |
|
7
|
|
|
use Nette\Http\Request; |
|
8
|
|
|
|
|
9
|
|
|
/** |
|
10
|
|
|
* This file handles the retrieval and serving of news articles |
|
11
|
|
|
*/ |
|
12
|
|
|
class DashboardPresenter extends BasePresenter |
|
13
|
|
|
{ |
|
14
|
|
|
|
|
15
|
|
|
/** |
|
16
|
|
|
* @var ProgramOverviewControl |
|
17
|
|
|
*/ |
|
18
|
|
|
private $programOverview; |
|
19
|
|
|
|
|
20
|
|
|
/** |
|
21
|
|
|
* @param MeetingModel $model |
|
22
|
|
|
* @param ProgramOverviewControl $control |
|
23
|
|
|
*/ |
|
24
|
|
|
public function __construct( |
|
25
|
|
|
MeetingModel $model, |
|
26
|
|
|
ProgramOverviewControl $control |
|
27
|
|
|
) { |
|
28
|
|
|
$this->setModel($model); |
|
|
|
|
|
|
29
|
|
|
$this->setProgramOverviewControl($control); |
|
30
|
|
|
} |
|
31
|
|
|
|
|
32
|
|
|
/** |
|
33
|
|
|
* @return void |
|
34
|
|
|
*/ |
|
35
|
|
|
public function startup() |
|
36
|
|
|
{ |
|
37
|
|
|
parent::startup(); |
|
38
|
|
|
|
|
39
|
|
|
$this->getModel()->setMeetingId($this->getMeetingId()); |
|
40
|
|
|
} |
|
41
|
|
|
|
|
42
|
|
|
/** |
|
43
|
|
|
* Render entire page |
|
44
|
|
|
* @return void |
|
45
|
|
|
*/ |
|
46
|
|
|
public function renderDefault() |
|
47
|
|
|
{ |
|
48
|
|
|
$template = $this->getTemplate(); |
|
49
|
|
|
$template->data = $this->getModel()->find($this->getMeetingId()); |
|
|
|
|
|
|
50
|
|
|
|
|
51
|
|
|
$template->error_start = ""; |
|
|
|
|
|
|
52
|
|
|
$template->error_end = ""; |
|
|
|
|
|
|
53
|
|
|
$template->error_open_reg = ""; |
|
|
|
|
|
|
54
|
|
|
$template->error_close_reg = ""; |
|
|
|
|
|
|
55
|
|
|
$template->error_login = ""; |
|
|
|
|
|
|
56
|
|
|
} |
|
57
|
|
|
|
|
58
|
|
|
/** |
|
59
|
|
|
* @return ProgramOverviewControl |
|
60
|
|
|
*/ |
|
61
|
|
|
protected function createComponentProgramOverview() |
|
62
|
|
|
{ |
|
63
|
|
|
return $this->programOverview->setMeetingId($this->getMeetingId()); |
|
64
|
|
|
} |
|
65
|
|
|
|
|
66
|
|
|
/** |
|
67
|
|
|
* @param ProgramOverviewControl $control |
|
68
|
|
|
* @return $this |
|
69
|
|
|
*/ |
|
70
|
|
|
protected function setProgramOverviewControl(ProgramOverviewControl $control) |
|
71
|
|
|
{ |
|
72
|
|
|
$this->programOverview = $control; |
|
73
|
|
|
|
|
74
|
|
|
return $this; |
|
75
|
|
|
} |
|
76
|
|
|
|
|
77
|
|
|
} |
|
78
|
|
|
|
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: