1 | <?php |
||
13 | class IndexSettings |
||
14 | { |
||
15 | private $namespace; |
||
16 | private $indexName; |
||
17 | private $alias; |
||
18 | private $indexMetadata; |
||
19 | private $propertyMetadata; |
||
20 | private $hosts; |
||
21 | private $defaultIndex = false; |
||
22 | |||
23 | public function __construct( |
||
24 | string $namespace, |
||
25 | string $indexName, |
||
26 | string $alias, |
||
27 | array $indexMetadata = [], |
||
28 | array $propertyMetadata = [], |
||
29 | array $hosts = [], |
||
30 | bool $defaultIndex = false |
||
31 | ) { |
||
32 | $this->namespace = $namespace; |
||
33 | $this->indexName = $indexName; |
||
34 | $this->alias = $alias; |
||
35 | $this->indexMetadata = $indexMetadata; |
||
36 | $this->propertyMetadata = $propertyMetadata; |
||
37 | $this->hosts = $hosts; |
||
38 | $this->defaultIndex = $defaultIndex; |
||
39 | } |
||
40 | |||
41 | public function getNamespace() |
||
42 | { |
||
43 | return $this->namespace; |
||
44 | } |
||
45 | |||
46 | public function setNamespace($namespace): void |
||
47 | { |
||
48 | $this->namespace = $namespace; |
||
49 | } |
||
50 | |||
51 | public function getIndexName() |
||
52 | { |
||
53 | return $this->indexName; |
||
54 | } |
||
55 | |||
56 | public function setIndexName($indexName): void |
||
57 | { |
||
58 | $this->indexName = $indexName; |
||
59 | } |
||
60 | |||
61 | public function getAlias() |
||
62 | { |
||
63 | return $this->alias; |
||
64 | } |
||
65 | |||
66 | public function setAlias($alias): void |
||
67 | { |
||
68 | $this->alias = $alias; |
||
69 | } |
||
70 | |||
71 | public function getIndexMetadata() |
||
75 | |||
76 | public function setIndexMetadata($indexMetadata): void |
||
77 | { |
||
78 | $this->indexMetadata = array_filter(array_merge_recursive( |
||
79 | $this->indexMetadata, |
||
80 | $indexMetadata |
||
81 | )); |
||
82 | } |
||
83 | |||
84 | public function getPropertyMetadata(): array |
||
88 | |||
89 | public function setPropertyMetadata(array $propertyMetadata): void |
||
93 | |||
94 | public function getHosts() |
||
98 | |||
99 | public function setHosts($hosts): void |
||
103 | |||
104 | public function isDefaultIndex(): bool |
||
108 | |||
109 | public function setDefaultIndex(bool $defaultIndex): void |
||
113 | } |
||
114 |