|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
declare(strict_types=1); |
|
4
|
|
|
|
|
5
|
|
|
namespace LAG\AdminBundle\Admin\View; |
|
6
|
|
|
|
|
7
|
|
|
use LAG\AdminBundle\Admin\AdminInterface; |
|
8
|
|
|
use LAG\AdminBundle\Admin\Configuration\AdminConfiguration; |
|
9
|
|
|
use LAG\AdminBundle\View\Template\Template; |
|
10
|
|
|
use LAG\AdminBundle\View\ViewInterface; |
|
11
|
|
|
|
|
12
|
|
|
class AdminView implements ViewInterface |
|
13
|
|
|
{ |
|
14
|
|
|
private ActionView $action; |
|
15
|
|
|
|
|
16
|
|
|
public function __construct( |
|
17
|
|
|
private AdminInterface $admin, |
|
18
|
|
|
private Template $template, |
|
19
|
|
|
private array $fields = [], |
|
20
|
|
|
private array $forms = [] |
|
21
|
|
|
) { |
|
22
|
|
|
$this->action = $this->admin->getAction()->createView(); |
|
23
|
|
|
} |
|
24
|
|
|
|
|
25
|
|
|
public function getData() |
|
26
|
|
|
{ |
|
27
|
|
|
return $this->admin->getData(); |
|
28
|
|
|
} |
|
29
|
|
|
|
|
30
|
|
|
public function getAction(): ActionView |
|
31
|
|
|
{ |
|
32
|
|
|
return $this->action; |
|
33
|
|
|
} |
|
34
|
|
|
|
|
35
|
|
|
public function getTitle(): string |
|
36
|
|
|
{ |
|
37
|
|
|
return $this->action->getConfiguration()->getTitle(); |
|
38
|
|
|
} |
|
39
|
|
|
|
|
40
|
|
|
public function getName(): string |
|
41
|
|
|
{ |
|
42
|
|
|
return $this->admin->getName(); |
|
43
|
|
|
} |
|
44
|
|
|
|
|
45
|
|
|
public function getFields(): array |
|
46
|
|
|
{ |
|
47
|
|
|
return $this->fields; |
|
48
|
|
|
} |
|
49
|
|
|
|
|
50
|
|
|
public function getConfiguration(): AdminConfiguration |
|
51
|
|
|
{ |
|
52
|
|
|
return $this->admin->getConfiguration(); |
|
53
|
|
|
} |
|
54
|
|
|
|
|
55
|
|
|
public function getTemplate(): string |
|
56
|
|
|
{ |
|
57
|
|
|
return $this->template->getTemplate(); |
|
58
|
|
|
} |
|
59
|
|
|
|
|
60
|
|
|
public function getBase(): string |
|
61
|
|
|
{ |
|
62
|
|
|
return $this->template->getBase(); |
|
63
|
|
|
} |
|
64
|
|
|
|
|
65
|
|
|
public function getForms(): array |
|
66
|
|
|
{ |
|
67
|
|
|
return $this->forms; |
|
68
|
|
|
} |
|
69
|
|
|
|
|
70
|
|
|
public function getListActions(): array |
|
71
|
|
|
{ |
|
72
|
|
|
return $this->action->getConfiguration()->getListActions(); |
|
73
|
|
|
} |
|
74
|
|
|
|
|
75
|
|
|
public function getItemActions(): array |
|
76
|
|
|
{ |
|
77
|
|
|
return $this->action->getConfiguration()->getItemActions(); |
|
78
|
|
|
} |
|
79
|
|
|
} |
|
80
|
|
|
|