Completed
Pull Request — develop (#453)
by
unknown
12:56 queued 07:13
created

Target::setIndexes()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 1
CRAP Score 1

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 5
ccs 1
cts 1
cp 1
rs 9.4285
cc 1
eloc 3
nc 1
nop 1
crap 1
1
<?php
2
/**
3
 * Part of JSON definition
4
 */
5
namespace Graviton\GeneratorBundle\Definition\Schema;
6
7
/**
8
 * JSON definition "target"
9
 *
10
 * @author   List of contributors <https://github.com/libgraviton/graviton/graphs/contributors>
11
 * @license  http://opensource.org/licenses/gpl-license.php GNU Public License
12
 * @link     http://swisscom.ch
13
 */
14
class Target
15
{
16
    /**
17
     * @var Relation[]
18
     */
19
    private $relations = [];
20
    /**
21
     * @var Field[]
22
     */
23
    private $fields = [];
24
25
    /**
26
     * @var string[]
27
     */
28
    private $indexes = [];
29
30
    /**
31
     * @var string[]
32
     */
33 32
    private $textIndexes = [];
34
35 32
    /**
36
     * @return Relation[]
37
     */
38
    public function getRelations()
39
    {
40
        return $this->relations;
41
    }
42 2
43
    /**
44 2
     * @param Relation[] $relations Relations
45 2
     * @return $this
46
     */
47
    public function setRelations(array $relations)
48
    {
49
        $this->relations = $relations;
50
        return $this;
51
    }
52 4
53
    /**
54 4
     * @param Relation $relation Relation
55 4
     * @return $this
56
     */
57
    public function addRelation(Relation $relation)
58
    {
59
        $this->relations[] = $relation;
60
        return $this;
61 32
    }
62
63 32
    /**
64
     * @return Field[]
65
     */
66
    public function getFields()
67
    {
68
        return $this->fields;
69
    }
70 2
71
    /**
72 2
     * @param Field[] $fields Fields
73 2
     * @return $this
74
     */
75
    public function setFields(array $fields)
76
    {
77
        $this->fields = $fields;
78
        return $this;
79
    }
80 10
81
    /**
82 10
     * @param Field $field Field
83 10
     * @return $this
84
     */
85
    public function addField(Field $field)
86
    {
87
        $this->fields[] = $field;
88
        return $this;
89
    }
90
91
    /**
92
     * @param string[] $indexes indexes from json def
93
     * @return $this
94
     */
95
    public function setIndexes($indexes)
96
    {
97
        $this->indexes = $indexes;
98
        return $this;
99 2
    }
100
101 2
    /**
102
     * @return string[]
103
     */
104
    public function getIndexes()
105
    {
106
        return $this->indexes;
107
    }
108
109
    /**
110
     * @return string[]
111
     */
112
    public function getTextIndexes()
113
    {
114
        return $this->textIndexes;
115
    }
116
117
    /**
118
     * @param string[] $textIndexes indexes from json def
119
     * @return $this
120
     */
121
    public function setTextIndexes($textIndexes)
122
    {
123
        $this->textIndexes = $textIndexes;
124
        return $this;
125
    }
126
}
127