Passed
Pull Request — master (#116)
by Arnaud
05:44 queued 02:35
created

FieldEvent::getType()   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
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace LAG\AdminBundle\Event\Events;
4
5
use LAG\AdminBundle\Field\FieldInterface;
6
use Symfony\Component\EventDispatcher\Event;
7
8
class FieldEvent extends Event
9
{
10
    /**
11
     * @var string
12
     */
13
    private $adminName;
14
15
    /**
16
     * @var string
17
     */
18
    private $actionName;
19
20
    /**
21
     * @var string
22
     */
23
    private $fieldName;
24
25
    /**
26
     * @var string|null
27
     */
28
    private $type;
29
30
    /**
31
     * @var FieldInterface|null
32
     */
33
    private $field;
34
35
    /**
36
     * @var string
37
     */
38
    private $entityClass;
39
40
    /**
41
     * @var array
42
     */
43
    private $options = [];
44
45
    public function __construct(
46
        string $adminName,
47
        string $actionName,
48
        string $fieldName,
49
        string $entityClass,
50
        string $type = null,
51
        FieldInterface $field = null
52
    ) {
53
        $this->adminName = $adminName;
54
        $this->actionName = $actionName;
55
        $this->fieldName = $fieldName;
56
        $this->type = $type;
57
        $this->field = $field;
58
        $this->entityClass = $entityClass;
59
    }
60
61
    /**
62
     * @param string|null $type
63
     */
64
    public function setType(?string $type): void
65
    {
66
        $this->type = $type;
67
    }
68
69
    /**
70
     * @param array $options
71
     */
72
    public function setOptions(array $options): void
73
    {
74
        $this->options = $options;
75
    }
76
77
    /**
78
     * @return string
79
     */
80
    public function getAdminName(): string
81
    {
82
        return $this->adminName;
83
    }
84
85
    /**
86
     * @return string
87
     */
88
    public function getActionName(): string
89
    {
90
        return $this->actionName;
91
    }
92
93
    /**
94
     * @return string
95
     */
96
    public function getFieldName(): string
97
    {
98
        return $this->fieldName;
99
    }
100
101
    /**
102
     * @return string|null
103
     */
104
    public function getType(): ?string
105
    {
106
        return $this->type;
107
    }
108
109
    /**
110
     * @return FieldInterface|null
111
     */
112
    public function getField(): ?FieldInterface
113
    {
114
        return $this->field;
115
    }
116
117
    /**
118
     * @return string
119
     */
120
    public function getEntityClass(): string
121
    {
122
        return $this->entityClass;
123
    }
124
125
    /**
126
     * @return array
127
     */
128
    public function getOptions(): array
129
    {
130
        return $this->options;
131
    }
132
}
133