|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
namespace GroupByInc\API\Model\Navigation; |
|
4
|
|
|
|
|
5
|
|
|
class Order |
|
6
|
|
|
{ |
|
7
|
|
|
const Count_Ascending = 'Count_Ascending'; |
|
8
|
|
|
const Count_Descending = 'Count_Descending'; |
|
9
|
|
|
const Value_Ascending = 'Value_Ascending'; |
|
10
|
|
|
const Value_Descending = 'Value_Descending'; |
|
11
|
|
|
} |
|
12
|
|
|
|
|
13
|
|
|
class Type |
|
14
|
|
|
{ |
|
15
|
|
|
const Date = 'Date'; |
|
16
|
|
|
const Float = 'Float'; |
|
17
|
|
|
const Integer = 'Integer'; |
|
18
|
|
|
const String = 'String'; |
|
19
|
|
|
const Range_Date = 'Range_Date'; |
|
20
|
|
|
const Range_Integer = 'Range_Integer'; |
|
21
|
|
|
const Range_Float = 'Range_Float'; |
|
22
|
|
|
} |
|
23
|
|
|
|
|
24
|
|
|
namespace GroupByInc\API\Model; |
|
25
|
|
|
|
|
26
|
|
|
use JMS\Serializer\Annotation as JMS; |
|
27
|
|
|
|
|
28
|
|
|
class Navigation |
|
29
|
|
|
{ |
|
30
|
|
|
/** |
|
31
|
|
|
* @var string |
|
32
|
|
|
* @JMS\Type("string") |
|
33
|
|
|
* @JMS\SerializedName("_id") |
|
34
|
|
|
*/ |
|
35
|
|
|
public $id; |
|
36
|
|
|
/** |
|
37
|
|
|
* @var string |
|
38
|
|
|
* @JMS\Type("string") |
|
39
|
|
|
*/ |
|
40
|
|
|
public $name; |
|
41
|
|
|
/** |
|
42
|
|
|
* @var string |
|
43
|
|
|
* @JMS\Type("string") |
|
44
|
|
|
*/ |
|
45
|
|
|
public $type; |
|
46
|
|
|
/** |
|
47
|
|
|
* @var Sort |
|
48
|
|
|
* @JMS\Type("GroupByInc\API\Model\Sort") |
|
49
|
|
|
*/ |
|
50
|
|
|
public $sort; |
|
51
|
|
|
/** |
|
52
|
|
|
* @var string |
|
53
|
|
|
* @JMS\Type("string") |
|
54
|
|
|
*/ |
|
55
|
|
|
public $displayName; |
|
56
|
|
|
/** |
|
57
|
|
|
* @var bool |
|
58
|
|
|
* @JMS\Type("boolean") |
|
59
|
|
|
*/ |
|
60
|
|
|
public $range = false; |
|
61
|
|
|
/** |
|
62
|
|
|
* @var bool |
|
63
|
|
|
* @JMS\Type("boolean") |
|
64
|
|
|
*/ |
|
65
|
|
|
public $or = false; |
|
66
|
|
|
/** |
|
67
|
|
|
* @var bool |
|
68
|
|
|
* @JMS\Type("boolean") |
|
69
|
|
|
*/ |
|
70
|
|
|
public $moreRefinements = false; |
|
71
|
|
|
/** |
|
72
|
|
|
* @var Refinement[] |
|
73
|
|
|
* @JMS\Type("array<GroupByInc\API\Model\Refinement>") |
|
74
|
|
|
*/ |
|
75
|
|
|
public $refinements = array(); |
|
76
|
|
|
/** |
|
77
|
|
|
* @var Metadata[] |
|
78
|
|
|
* @JMS\Type("array<GroupByInc\API\Model\Metadata>") |
|
79
|
|
|
*/ |
|
80
|
|
|
public $metadata = array(); |
|
81
|
|
|
|
|
82
|
|
|
/** |
|
83
|
|
|
* @var bool |
|
84
|
|
|
* @JMS\Type("boolean") |
|
85
|
|
|
*/ |
|
86
|
|
|
public $ignored = false; |
|
87
|
|
|
|
|
88
|
|
|
/** |
|
89
|
|
|
* @return string The name of the dynamic navigation attribute. |
|
90
|
|
|
*/ |
|
91
|
|
|
public function getName() |
|
92
|
|
|
{ |
|
93
|
|
|
return $this->name; |
|
94
|
|
|
} |
|
95
|
|
|
|
|
96
|
|
|
/** |
|
97
|
|
|
* @param string $name The name of the navigation. |
|
98
|
|
|
* |
|
99
|
|
|
* @return Navigation |
|
100
|
|
|
*/ |
|
101
|
|
|
public function setName($name) |
|
102
|
|
|
{ |
|
103
|
|
|
$this->name = $name; |
|
104
|
|
|
return $this; |
|
105
|
|
|
} |
|
106
|
|
|
|
|
107
|
|
|
/** |
|
108
|
|
|
* @return string The human readable label for this navigation. |
|
109
|
|
|
*/ |
|
110
|
|
|
public function getDisplayName() |
|
111
|
|
|
{ |
|
112
|
|
|
return $this->displayName; |
|
113
|
|
|
} |
|
114
|
|
|
|
|
115
|
|
|
/** |
|
116
|
|
|
* @param string $displayName Set the display name. |
|
117
|
|
|
* |
|
118
|
|
|
* @return Navigation |
|
119
|
|
|
*/ |
|
120
|
|
|
public function setDisplayName($displayName) |
|
121
|
|
|
{ |
|
122
|
|
|
$this->displayName = $displayName; |
|
123
|
|
|
return $this; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* @return Refinement[] A list of refinement values that represent the ways in which you can filter data. |
|
128
|
|
|
*/ |
|
129
|
|
|
public function &getRefinements() |
|
130
|
|
|
{ |
|
131
|
|
|
return $this->refinements; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
/** |
|
135
|
|
|
* @param Refinement[] $refinements The refinement values. |
|
136
|
|
|
* |
|
137
|
|
|
* @return Navigation |
|
138
|
|
|
*/ |
|
139
|
|
|
public function setRefinements($refinements) |
|
140
|
|
|
{ |
|
141
|
|
|
$this->refinements = $refinements; |
|
142
|
|
|
return $this; |
|
143
|
|
|
} |
|
144
|
|
|
|
|
145
|
|
|
/** |
|
146
|
|
|
* @return string A MD5 of the name, which means that this navigation ID is unique. |
|
147
|
|
|
*/ |
|
148
|
|
|
public function getId() |
|
149
|
|
|
{ |
|
150
|
|
|
return $this->id; |
|
151
|
|
|
} |
|
152
|
|
|
|
|
153
|
|
|
/** |
|
154
|
|
|
* @param string $id Set the ID. |
|
155
|
|
|
* |
|
156
|
|
|
* @return Navigation |
|
157
|
|
|
*/ |
|
158
|
|
|
public function setId($id) |
|
159
|
|
|
{ |
|
160
|
|
|
$this->id = $id; |
|
161
|
|
|
return $this; |
|
162
|
|
|
} |
|
163
|
|
|
|
|
164
|
|
|
/** |
|
165
|
|
|
* @return bool True if this navigation is a of type range. |
|
166
|
|
|
*/ |
|
167
|
|
|
public function isRange() |
|
168
|
|
|
{ |
|
169
|
|
|
return $this->range; |
|
170
|
|
|
} |
|
171
|
|
|
|
|
172
|
|
|
/** |
|
173
|
|
|
* @param bool $range Set range. |
|
174
|
|
|
* |
|
175
|
|
|
* @return Navigation |
|
176
|
|
|
*/ |
|
177
|
|
|
public function setRange($range) |
|
178
|
|
|
{ |
|
179
|
|
|
$this->range = $range; |
|
180
|
|
|
return $this; |
|
181
|
|
|
} |
|
182
|
|
|
|
|
183
|
|
|
/** |
|
184
|
|
|
* @return bool Is this dynamic navigation going to be treated as an OR field in the bridge layer. |
|
185
|
|
|
*/ |
|
186
|
|
|
public function isOr() |
|
187
|
|
|
{ |
|
188
|
|
|
return $this->or; |
|
189
|
|
|
} |
|
190
|
|
|
|
|
191
|
|
|
/** |
|
192
|
|
|
* @param bool $or Set whether this is an OR field. |
|
193
|
|
|
* |
|
194
|
|
|
* @return Navigation |
|
195
|
|
|
*/ |
|
196
|
|
|
public function setOr($or) |
|
197
|
|
|
{ |
|
198
|
|
|
$this->or = $or; |
|
199
|
|
|
return $this; |
|
200
|
|
|
} |
|
201
|
|
|
|
|
202
|
|
|
/** |
|
203
|
|
|
* @return string The type of navigation. |
|
204
|
|
|
*/ |
|
205
|
|
|
public function getType() |
|
206
|
|
|
{ |
|
207
|
|
|
return $this->type; |
|
208
|
|
|
} |
|
209
|
|
|
|
|
210
|
|
|
/** |
|
211
|
|
|
* @param string $type Set the type of navigation. |
|
212
|
|
|
* |
|
213
|
|
|
* @return Navigation |
|
214
|
|
|
*/ |
|
215
|
|
|
public function setType($type) |
|
216
|
|
|
{ |
|
217
|
|
|
$this->type = $type; |
|
218
|
|
|
return $this; |
|
219
|
|
|
} |
|
220
|
|
|
|
|
221
|
|
|
/** |
|
222
|
|
|
* @return Sort The sort option for this navigation. |
|
223
|
|
|
*/ |
|
224
|
|
|
public function getSort() |
|
225
|
|
|
{ |
|
226
|
|
|
return $this->sort; |
|
227
|
|
|
} |
|
228
|
|
|
|
|
229
|
|
|
/** |
|
230
|
|
|
* @param Sort $sort Set the sort type. |
|
231
|
|
|
* |
|
232
|
|
|
* @return Navigation |
|
233
|
|
|
*/ |
|
234
|
|
|
public function setSort($sort) |
|
235
|
|
|
{ |
|
236
|
|
|
$this->sort = $sort; |
|
237
|
|
|
return $this; |
|
238
|
|
|
} |
|
239
|
|
|
|
|
240
|
|
|
/** |
|
241
|
|
|
* @return Metadata[] A list of metadata elements. |
|
242
|
|
|
*/ |
|
243
|
|
|
public function getMetadata() |
|
244
|
|
|
{ |
|
245
|
|
|
return $this->metadata; |
|
246
|
|
|
} |
|
247
|
|
|
|
|
248
|
|
|
/** |
|
249
|
|
|
* @param Metadata[] $metadata Set the metadata. |
|
250
|
|
|
* |
|
251
|
|
|
* @return Navigation |
|
252
|
|
|
*/ |
|
253
|
|
|
public function setMetadata($metadata) |
|
254
|
|
|
{ |
|
255
|
|
|
$this->metadata = $metadata; |
|
256
|
|
|
return $this; |
|
257
|
|
|
} |
|
258
|
|
|
|
|
259
|
|
|
/** |
|
260
|
|
|
* @return bool True if this navigation has more refinement values than the ones returned, false otherwise. |
|
261
|
|
|
*/ |
|
262
|
|
|
public function getMoreRefinements() |
|
263
|
|
|
{ |
|
264
|
|
|
return $this->moreRefinements; |
|
265
|
|
|
} |
|
266
|
|
|
|
|
267
|
|
|
/** |
|
268
|
|
|
* @param bool $moreRefinements True if this navigation has more refinement values than the ones returned. |
|
269
|
|
|
* |
|
270
|
|
|
* @return $this |
|
271
|
|
|
*/ |
|
272
|
|
|
public function setMoreRefinements($moreRefinements) |
|
273
|
|
|
{ |
|
274
|
|
|
$this->moreRefinements = $moreRefinements; |
|
275
|
|
|
return $this; |
|
276
|
|
|
} |
|
277
|
|
|
|
|
278
|
|
|
/** |
|
279
|
|
|
* @return bool |
|
280
|
|
|
*/ |
|
281
|
|
|
public function getIgnored() |
|
282
|
|
|
{ |
|
283
|
|
|
return $this->ignored; |
|
284
|
|
|
} |
|
285
|
|
|
|
|
286
|
|
|
/** |
|
287
|
|
|
* @param bool $ignored |
|
288
|
|
|
* |
|
289
|
|
|
* @return $this |
|
290
|
|
|
*/ |
|
291
|
|
|
public function setIgnored($ignored) |
|
292
|
|
|
{ |
|
293
|
|
|
$this->ignored = $ignored; |
|
294
|
|
|
return $this; |
|
295
|
|
|
} |
|
296
|
|
|
|
|
297
|
|
|
} |