Passed
Push — dev ( 40f0b5...3a2e98 )
by Fike
02:50
created

View::getChildViews()   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
namespace AmaTeam\ElasticSearch\API\Entity\Mapping\Property;
4
5
class View implements ViewInterface
6
{
7
    /**
8
     * @var string
9
     */
10
    private $type;
11
    /**
12
     * @var array
13
     */
14
    private $parameters = [];
15
    /**
16
     * @var string|null
17
     */
18
    private $targetEntity;
19
    /**
20
     * @var string[]
21
     */
22
    private $childViews = [];
23
    /**
24
     * @var bool
25
     */
26
    private $appendChildViews = true;
27
28
    /**
29
     * @return string
30
     */
31
    public function getType(): ?string
32
    {
33
        return $this->type;
34
    }
35
36
    /**
37
     * @param string $type
38
     * @return $this
39
     */
40
    public function setType(string $type): View
41
    {
42
        $this->type = $type;
43
        return $this;
44
    }
45
46
    /**
47
     * @return array
48
     */
49
    public function getParameters(): array
50
    {
51
        return $this->parameters;
52
    }
53
54
    /**
55
     * @param array $parameters
56
     * @return $this
57
     */
58
    public function setParameters(array $parameters): View
59
    {
60
        $this->parameters = $parameters;
61
        return $this;
62
    }
63
64
    public function setParameter(string $parameter, $value): View
65
    {
66
        $this->parameters[$parameter] = $value;
67
        return $this;
68
    }
69
70
    /**
71
     * @return string
72
     */
73
    public function getTargetEntity(): ?string
74
    {
75
        return $this->targetEntity;
76
    }
77
78
    /**
79
     * @param string $targetEntity
80
     * @return $this
81
     */
82
    public function setTargetEntity(string $targetEntity): View
83
    {
84
        $this->targetEntity = $targetEntity;
85
        return $this;
86
    }
87
88
    /**
89
     * @return string[]
90
     */
91
    public function getChildViews(): array
92
    {
93
        return $this->childViews;
94
    }
95
96
    /**
97
     * @param string[] $childViews
98
     * @return $this
99
     */
100
    public function setChildViews(array $childViews): View
101
    {
102
        $this->childViews = $childViews;
103
        return $this;
104
    }
105
106
    /**
107
     * @return bool
108
     */
109
    public function shouldAppendChildViews(): bool
110
    {
111
        return $this->appendChildViews;
112
    }
113
114
    /**
115
     * @param bool $appendChildViews
116
     * @return $this
117
     */
118
    public function setAppendChildViews(bool $appendChildViews): View
119
    {
120
        $this->appendChildViews = $appendChildViews;
121
        return $this;
122
    }
123
}
124