IndexContext::getTypeContexts()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
cc 1
eloc 2
nc 1
nop 0
crap 1
1
<?php
2
3
namespace Zenstruck\ElasticaBundle\Elastica;
4
5
use Elastica\Index;
6
7
/**
8
 * @author Kevin Bond <[email protected]>
9
 */
10
class IndexContext
11
{
12
    private $alias;
13
    private $typeContexts;
14
    private $settings;
15
    private $indicies;
16
17
    /**
18
     * @param Index         $alias
19
     * @param TypeContext[] $typeContexts
20
     * @param array         $settings
21
     */
22 7
    public function __construct(Index $alias, array $typeContexts, array $settings = null)
23
    {
24 7
        $this->alias = $alias;
25 7
        $this->typeContexts = $typeContexts;
26 7
        $this->settings = $settings;
27
28 7
        $client = $alias->getClient();
29
30 7
        $this->indicies = array(
31 7
            new Index($client, $alias->getName().'1'),
32 7
            new Index($client, $alias->getName().'2'),
33
        );
34 7
    }
35
36
    /**
37
     * @return Index
38
     */
39 5
    public function getAlias()
40
    {
41 5
        return $this->alias;
42
    }
43
44
    /**
45
     * @return TypeContext[]
46
     */
47 5
    public function getTypeContexts()
48
    {
49 5
        return $this->typeContexts;
50
    }
51
52
    /**
53
     * @return array|null
54
     */
55 5
    public function getSettings()
56
    {
57 5
        return $this->settings;
58
    }
59
60
    /**
61
     * @return Index[]
62
     */
63 7
    public function getIndicies()
64
    {
65 7
        return $this->indicies;
66
    }
67
}
68