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
|
|
|
private $textIndexes = []; |
34
|
|
|
|
35
|
|
|
/** |
36
|
|
|
* @return Relation[] |
37
|
|
|
*/ |
38
|
32 |
|
public function getRelations() |
39
|
|
|
{ |
40
|
32 |
|
return $this->relations; |
41
|
|
|
} |
42
|
|
|
|
43
|
|
|
/** |
44
|
|
|
* @param Relation[] $relations Relations |
45
|
|
|
* @return $this |
46
|
|
|
*/ |
47
|
2 |
|
public function setRelations(array $relations) |
48
|
|
|
{ |
49
|
2 |
|
$this->relations = $relations; |
50
|
2 |
|
return $this; |
51
|
|
|
} |
52
|
|
|
|
53
|
|
|
/** |
54
|
|
|
* @param Relation $relation Relation |
55
|
|
|
* @return $this |
56
|
|
|
*/ |
57
|
4 |
|
public function addRelation(Relation $relation) |
58
|
|
|
{ |
59
|
4 |
|
$this->relations[] = $relation; |
60
|
4 |
|
return $this; |
61
|
|
|
} |
62
|
|
|
|
63
|
|
|
/** |
64
|
|
|
* @return Field[] |
65
|
|
|
*/ |
66
|
32 |
|
public function getFields() |
67
|
|
|
{ |
68
|
32 |
|
return $this->fields; |
69
|
|
|
} |
70
|
|
|
|
71
|
|
|
/** |
72
|
|
|
* @param Field[] $fields Fields |
73
|
|
|
* @return $this |
74
|
|
|
*/ |
75
|
2 |
|
public function setFields(array $fields) |
76
|
|
|
{ |
77
|
2 |
|
$this->fields = $fields; |
78
|
2 |
|
return $this; |
79
|
|
|
} |
80
|
|
|
|
81
|
|
|
/** |
82
|
|
|
* @param Field $field Field |
83
|
|
|
* @return $this |
84
|
|
|
*/ |
85
|
10 |
|
public function addField(Field $field) |
86
|
|
|
{ |
87
|
10 |
|
$this->fields[] = $field; |
88
|
10 |
|
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
|
|
|
} |
100
|
|
|
|
101
|
|
|
/** |
102
|
|
|
* @return string[] |
103
|
|
|
*/ |
104
|
2 |
|
public function getIndexes() |
105
|
|
|
{ |
106
|
2 |
|
return $this->indexes; |
107
|
|
|
} |
108
|
|
|
|
109
|
|
|
/** |
110
|
|
|
* @return string[] |
111
|
|
|
*/ |
112
|
2 |
|
public function getTextIndexes() |
113
|
|
|
{ |
114
|
2 |
|
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
|
|
|
|