Passed
Push — feature/initial-implementation ( fae671...591f29 )
by Fike
02:37
created

Entity::getIndexing()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 3
c 0
b 0
f 0
rs 10
cc 1
eloc 1
nc 1
nop 0
1
<?php
2
3
declare(strict_types=1);
4
5
namespace AmaTeam\ElasticSearch\API;
6
7
use AmaTeam\ElasticSearch\API\Entity\Descriptor\Hierarchy\NodeInterface;
8
use AmaTeam\ElasticSearch\API\Entity\DescriptorInterface;
9
10
class Entity implements EntityInterface
11
{
12
    /**
13
     * @var string
14
     */
15
    private $name;
16
    /**
17
     * @var string[]
18
     */
19
    private $parentNames = [];
20
    /**
21
     * @var bool
22
     */
23
    private $rootLevelDocument = false;
24
    /**
25
     * @var DescriptorInterface
26
     */
27
    private $originalDescriptor;
28
    /**
29
     * @var DescriptorInterface
30
     */
31
    private $compiledDescriptor;
32
    /**
33
     * @var NodeInterface
34
     */
35
    private $hierarchy;
36
    /**
37
     * @var MappingInterface
38
     */
39
    private $mapping;
40
    /**
41
     * @var IndexingInterface
42
     */
43
    private $indexing;
44
45
    /**
46
     * @param string $name
47
     */
48
    public function __construct($name)
49
    {
50
        $this->name = $name;
51
    }
52
53
    /**
54
     * @return string
55
     */
56
    public function getName(): string
57
    {
58
        return $this->name;
59
    }
60
61
    /**
62
     * @param string $name
63
     * @return $this
64
     */
65
    public function setName(string $name): Entity
66
    {
67
        $this->name = $name;
68
        return $this;
69
    }
70
71
    /**
72
     * @return string[]
73
     */
74
    public function getParentNames(): array
75
    {
76
        return $this->parentNames;
77
    }
78
79
    /**
80
     * @param string[] $parentNames
81
     * @return $this
82
     */
83
    public function setParentNames(array $parentNames): Entity
84
    {
85
        $this->parentNames = $parentNames;
86
        return $this;
87
    }
88
89
    /**
90
     * @return bool
91
     */
92
    public function isRootLevelDocument(): bool
93
    {
94
        return $this->rootLevelDocument;
95
    }
96
97
    /**
98
     * @param bool $rootLevelDocument
99
     * @return $this
100
     */
101
    public function setRootLevelDocument(bool $rootLevelDocument): Entity
102
    {
103
        $this->rootLevelDocument = $rootLevelDocument;
104
        return $this;
105
    }
106
107
    /**
108
     * @return DescriptorInterface
109
     */
110
    public function getOriginalDescriptor(): DescriptorInterface
111
    {
112
        return $this->originalDescriptor;
113
    }
114
115
    /**
116
     * @param DescriptorInterface $originalDescriptor
117
     * @return $this
118
     */
119
    public function setOriginalDescriptor(DescriptorInterface $originalDescriptor): Entity
120
    {
121
        $this->originalDescriptor = $originalDescriptor;
122
        return $this;
123
    }
124
125
    /**
126
     * @return DescriptorInterface
127
     */
128
    public function getCompiledDescriptor(): DescriptorInterface
129
    {
130
        return $this->compiledDescriptor;
131
    }
132
133
    /**
134
     * @param DescriptorInterface $compiledDescriptor
135
     * @return $this
136
     */
137
    public function setCompiledDescriptor(DescriptorInterface $compiledDescriptor): Entity
138
    {
139
        $this->compiledDescriptor = $compiledDescriptor;
140
        return $this;
141
    }
142
143
    /**
144
     * @return NodeInterface
145
     */
146
    public function getHierarchy(): NodeInterface
147
    {
148
        return $this->hierarchy;
149
    }
150
151
    /**
152
     * @param NodeInterface $hierarchy
153
     * @return $this
154
     */
155
    public function setHierarchy(NodeInterface $hierarchy): Entity
156
    {
157
        $this->hierarchy = $hierarchy;
158
        return $this;
159
    }
160
161
    /**
162
     * @return MappingInterface
163
     */
164
    public function getMapping(): MappingInterface
165
    {
166
        return $this->mapping;
167
    }
168
169
    /**
170
     * @param MappingInterface $mapping
171
     * @return $this
172
     */
173
    public function setMapping(MappingInterface $mapping): Entity
174
    {
175
        $this->mapping = $mapping;
176
        return $this;
177
    }
178
179
    /**
180
     * @return IndexingInterface
181
     */
182
    public function getIndexing(): IndexingInterface
183
    {
184
        return $this->indexing;
185
    }
186
187
    /**
188
     * @param IndexingInterface $indexing
189
     * @return $this
190
     */
191
    public function setIndexing(IndexingInterface $indexing): Entity
192
    {
193
        $this->indexing = $indexing;
194
        return $this;
195
    }
196
}
197