@@ 5-73 (lines=69) @@ | ||
2 | ||
3 | namespace AmaTeam\ElasticSearch\API\Entity\Normalization; |
|
4 | ||
5 | class Context implements ContextInterface |
|
6 | { |
|
7 | /** |
|
8 | * @var string[] |
|
9 | */ |
|
10 | private $preservedIndexingOptions = []; |
|
11 | /** |
|
12 | * @var string[] |
|
13 | */ |
|
14 | private $preservedMappingParameters = []; |
|
15 | /** |
|
16 | * @var bool |
|
17 | */ |
|
18 | private $preserveUnknownEntries = false; |
|
19 | ||
20 | /** |
|
21 | * @return string[] |
|
22 | */ |
|
23 | public function getPreservedIndexingOptions(): array |
|
24 | { |
|
25 | return $this->preservedIndexingOptions; |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * @param string[] $preservedIndexingOptions |
|
30 | * @return $this |
|
31 | */ |
|
32 | public function setPreservedIndexingOptions(array $preservedIndexingOptions): Context |
|
33 | { |
|
34 | $this->preservedIndexingOptions = $preservedIndexingOptions; |
|
35 | return $this; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return string[] |
|
40 | */ |
|
41 | public function getPreservedMappingParameters(): array |
|
42 | { |
|
43 | return $this->preservedMappingParameters; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param string[] $preservedMappingParameters |
|
48 | * @return $this |
|
49 | */ |
|
50 | public function setPreservedMappingParameters(array $preservedMappingParameters): Context |
|
51 | { |
|
52 | $this->preservedMappingParameters = $preservedMappingParameters; |
|
53 | return $this; |
|
54 | } |
|
55 | ||
56 | /** |
|
57 | * @return bool |
|
58 | */ |
|
59 | public function shouldPreserveUnknownEntries(): bool |
|
60 | { |
|
61 | return $this->preserveUnknownEntries; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param bool $preserveUnknownEntries |
|
66 | * @return $this |
|
67 | */ |
|
68 | public function setPreserveUnknownEntries(bool $preserveUnknownEntries): Context |
|
69 | { |
|
70 | $this->preserveUnknownEntries = $preserveUnknownEntries; |
|
71 | return $this; |
|
72 | } |
|
73 | } |
|
74 |
@@ 5-73 (lines=69) @@ | ||
2 | ||
3 | namespace AmaTeam\ElasticSearch\API\Entity\Validation; |
|
4 | ||
5 | class Context implements ContextInterface |
|
6 | { |
|
7 | /** |
|
8 | * @var string[] |
|
9 | */ |
|
10 | private $preservedIndexingOptions = []; |
|
11 | /** |
|
12 | * @var string[] |
|
13 | */ |
|
14 | private $preservedMappingParameters = []; |
|
15 | /** |
|
16 | * @var bool |
|
17 | */ |
|
18 | private $preserveUnknownEntries = false; |
|
19 | ||
20 | /** |
|
21 | * @return string[] |
|
22 | */ |
|
23 | public function getPreservedIndexingOptions(): array |
|
24 | { |
|
25 | return $this->preservedIndexingOptions; |
|
26 | } |
|
27 | ||
28 | /** |
|
29 | * @param string[] $preservedIndexingOptions |
|
30 | * @return $this |
|
31 | */ |
|
32 | public function setPreservedIndexingOptions(array $preservedIndexingOptions): Context |
|
33 | { |
|
34 | $this->preservedIndexingOptions = $preservedIndexingOptions; |
|
35 | return $this; |
|
36 | } |
|
37 | ||
38 | /** |
|
39 | * @return string[] |
|
40 | */ |
|
41 | public function getPreservedMappingParameters(): array |
|
42 | { |
|
43 | return $this->preservedMappingParameters; |
|
44 | } |
|
45 | ||
46 | /** |
|
47 | * @param string[] $preservedMappingParameters |
|
48 | * @return $this |
|
49 | */ |
|
50 | public function setPreservedMappingParameters(array $preservedMappingParameters): Context |
|
51 | { |
|
52 | $this->preservedMappingParameters = $preservedMappingParameters; |
|
53 | return $this; |
|
54 | } |
|
55 | ||
56 | /** |
|
57 | * @return bool |
|
58 | */ |
|
59 | public function shouldPreserveUnknownEntries(): bool |
|
60 | { |
|
61 | return $this->preserveUnknownEntries; |
|
62 | } |
|
63 | ||
64 | /** |
|
65 | * @param bool $preserveUnknownEntries |
|
66 | * @return $this |
|
67 | */ |
|
68 | public function setPreserveUnknownEntries(bool $preserveUnknownEntries): Context |
|
69 | { |
|
70 | $this->preserveUnknownEntries = $preserveUnknownEntries; |
|
71 | return $this; |
|
72 | } |
|
73 | } |
|
74 |