Passed
Pull Request — master (#300)
by Arnaud
15:59
created

AdminView::getName()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 3
rs 10
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