IndexSettings::setAlias()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 1
1
<?php
2
/*
3
 * This file is part of the ONGR package.
4
 *
5
 * (c) NFQ Technologies UAB <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace ONGR\ElasticsearchBundle\Mapping;
12
13
class IndexSettings
14
{
15
    private $namespace;
16
    private $indexName;
17
    private $alias;
18
    private $indexMetadata;
19
    private $hosts;
20
    private $defaultIndex = false;
21
22
    public function __construct(
23
        string $namespace,
24
        string $indexName,
25
        string $alias,
26
        array $indexMetadata = [],
27
        array $hosts = [],
28
        bool $defaultIndex = false
29
    ) {
30
        $this->namespace = $namespace;
31
        $this->indexName = $indexName;
32
        $this->alias = $alias;
33
        $this->indexMetadata = $indexMetadata;
34
        $this->hosts = $hosts;
35
        $this->defaultIndex = $defaultIndex;
36
    }
37
38
    public function getNamespace()
39
    {
40
        return $this->namespace;
41
    }
42
43
    public function setNamespace($namespace): self
44
    {
45
        $this->namespace = $namespace;
46
        return $this;
47
    }
48
49
    public function getIndexName()
50
    {
51
        return $this->indexName;
52
    }
53
54
    public function setIndexName($indexName): self
55
    {
56
        $this->indexName = $indexName;
57
        return $this;
58
    }
59
60
    public function getAlias()
61
    {
62
        return $this->alias;
63
    }
64
65
    public function setAlias($alias): self
66
    {
67
        $this->alias = $alias;
68
        return $this;
69
    }
70
71
    public function getIndexMetadata()
72
    {
73
        return $this->indexMetadata;
74
    }
75
76
    public function setIndexMetadata($indexMetadata): self
77
    {
78
        $this->indexMetadata = $indexMetadata;
79
        return $this;
80
    }
81
82
    public function getHosts()
83
    {
84
        return $this->hosts;
85
    }
86
87
    public function setHosts($hosts): self
88
    {
89
        $this->hosts = $hosts;
90
        return $this;
91
    }
92
93
    public function isDefaultIndex(): bool
94
    {
95
        return $this->defaultIndex;
96
    }
97
98
    public function setDefaultIndex(bool $defaultIndex): self
99
    {
100
        $this->defaultIndex = $defaultIndex;
101
        return $this;
102
    }
103
}
104