|
1
|
|
|
<?php |
|
2
|
|
|
namespace Wonnova\SDK\Model; |
|
3
|
|
|
|
|
4
|
|
|
use JMS\Serializer\Annotation as JMS; |
|
5
|
|
|
use Wonnova\SDK\Common\WonnovaDateTimeParserTrait; |
|
6
|
|
|
|
|
7
|
|
|
/** |
|
8
|
|
|
* Class Level |
|
9
|
|
|
* @author Wonnova |
|
10
|
|
|
* @link http://www.wonnova.com |
|
11
|
|
|
*/ |
|
12
|
|
|
class Level extends AbstractModel |
|
13
|
|
|
{ |
|
14
|
|
|
use WonnovaDateTimeParserTrait; |
|
15
|
|
|
|
|
16
|
|
|
/** |
|
17
|
|
|
* Used to map virtual to real fields |
|
18
|
|
|
* |
|
19
|
|
|
* @var array |
|
20
|
|
|
*/ |
|
21
|
|
|
protected $fieldMapping = [ |
|
22
|
|
|
'dynamic' => 'scenario' |
|
23
|
|
|
]; |
|
24
|
|
|
|
|
25
|
|
|
/** |
|
26
|
|
|
* @var string |
|
27
|
|
|
* @JMS\Type("string") |
|
28
|
|
|
*/ |
|
29
|
|
|
private $code; |
|
30
|
|
|
/** |
|
31
|
|
|
* @var string |
|
32
|
|
|
* @JMS\Type("string") |
|
33
|
|
|
*/ |
|
34
|
|
|
private $name; |
|
35
|
|
|
/** |
|
36
|
|
|
* @var int |
|
37
|
|
|
* @JMS\Type("integer") |
|
38
|
|
|
*/ |
|
39
|
|
|
private $score; |
|
40
|
|
|
/** |
|
41
|
|
|
* @var boolean |
|
42
|
|
|
* @JMS\Type("boolean") |
|
43
|
|
|
*/ |
|
44
|
|
|
private $generatesNotification; |
|
45
|
|
|
/** |
|
46
|
|
|
* @var boolean |
|
47
|
|
|
* @JMS\Type("boolean") |
|
48
|
|
|
*/ |
|
49
|
|
|
private $categoryEnabled; |
|
50
|
|
|
/** |
|
51
|
|
|
* @var string |
|
52
|
|
|
* @JMS\Type("string") |
|
53
|
|
|
*/ |
|
54
|
|
|
private $imageUrl; |
|
55
|
|
|
/** |
|
56
|
|
|
* @var \DateTime |
|
57
|
|
|
* @JMS\Type("WonnovaDateTime") |
|
58
|
|
|
*/ |
|
59
|
|
|
private $dateCreated; |
|
60
|
|
|
/** |
|
61
|
|
|
* @var Badge |
|
62
|
|
|
* @JMS\Type("Wonnova\SDK\Model\Badge") |
|
63
|
|
|
*/ |
|
64
|
|
|
private $badge; |
|
65
|
|
|
/** |
|
66
|
|
|
* @var Scenario |
|
67
|
|
|
* @JMS\Type("Wonnova\SDK\Model\Scenario") |
|
68
|
|
|
* @JMS\SerializedName("dynamic") |
|
69
|
|
|
*/ |
|
70
|
|
|
private $scenario; |
|
71
|
|
|
|
|
72
|
|
|
/** |
|
73
|
|
|
* @return string |
|
74
|
|
|
*/ |
|
75
|
4 |
|
public function getCode() |
|
76
|
|
|
{ |
|
77
|
4 |
|
return $this->code; |
|
78
|
|
|
} |
|
79
|
|
|
|
|
80
|
|
|
/** |
|
81
|
|
|
* @param string $code |
|
82
|
|
|
* @return $this |
|
83
|
|
|
*/ |
|
84
|
1 |
|
public function setCode($code) |
|
85
|
|
|
{ |
|
86
|
1 |
|
$this->code = $code; |
|
87
|
1 |
|
return $this; |
|
88
|
|
|
} |
|
89
|
|
|
|
|
90
|
|
|
/** |
|
91
|
|
|
* @return string |
|
92
|
|
|
*/ |
|
93
|
2 |
|
public function getName() |
|
94
|
|
|
{ |
|
95
|
2 |
|
return $this->name; |
|
96
|
|
|
} |
|
97
|
|
|
|
|
98
|
|
|
/** |
|
99
|
|
|
* @param string $name |
|
100
|
|
|
* @return $this |
|
101
|
|
|
*/ |
|
102
|
1 |
|
public function setName($name) |
|
103
|
|
|
{ |
|
104
|
1 |
|
$this->name = $name; |
|
105
|
1 |
|
return $this; |
|
106
|
|
|
} |
|
107
|
|
|
|
|
108
|
|
|
/** |
|
109
|
|
|
* @return int |
|
110
|
|
|
*/ |
|
111
|
2 |
|
public function getScore() |
|
112
|
|
|
{ |
|
113
|
2 |
|
return $this->score; |
|
114
|
|
|
} |
|
115
|
|
|
|
|
116
|
|
|
/** |
|
117
|
|
|
* @param int $score |
|
118
|
|
|
* @return $this |
|
119
|
|
|
*/ |
|
120
|
1 |
|
public function setScore($score) |
|
121
|
|
|
{ |
|
122
|
1 |
|
$this->score = $score; |
|
123
|
1 |
|
return $this; |
|
124
|
|
|
} |
|
125
|
|
|
|
|
126
|
|
|
/** |
|
127
|
|
|
* @return boolean |
|
128
|
|
|
*/ |
|
129
|
4 |
|
public function getGeneratesNotification() |
|
130
|
|
|
{ |
|
131
|
4 |
|
return $this->generatesNotification; |
|
132
|
|
|
} |
|
133
|
|
|
|
|
134
|
|
|
/** |
|
135
|
|
|
* @param boolean $generatesNotification |
|
136
|
|
|
* @return $this |
|
137
|
|
|
*/ |
|
138
|
1 |
|
public function setGeneratesNotification($generatesNotification) |
|
139
|
|
|
{ |
|
140
|
1 |
|
$this->generatesNotification = $generatesNotification; |
|
141
|
1 |
|
return $this; |
|
142
|
|
|
} |
|
143
|
|
|
|
|
144
|
|
|
/** |
|
145
|
|
|
* @return boolean |
|
146
|
|
|
*/ |
|
147
|
2 |
|
public function isCategoryEnabled() |
|
148
|
|
|
{ |
|
149
|
2 |
|
return $this->categoryEnabled; |
|
150
|
|
|
} |
|
151
|
|
|
|
|
152
|
|
|
/** |
|
153
|
|
|
* @param boolean $categoryEnabled |
|
154
|
|
|
* @return $this |
|
155
|
|
|
*/ |
|
156
|
1 |
|
public function setCategoryEnabled($categoryEnabled) |
|
157
|
|
|
{ |
|
158
|
1 |
|
$this->categoryEnabled = $categoryEnabled; |
|
159
|
1 |
|
return $this; |
|
160
|
|
|
} |
|
161
|
|
|
|
|
162
|
|
|
/** |
|
163
|
|
|
* @return string |
|
164
|
|
|
*/ |
|
165
|
4 |
|
public function getImageUrl() |
|
166
|
|
|
{ |
|
167
|
4 |
|
return $this->imageUrl; |
|
168
|
|
|
} |
|
169
|
|
|
|
|
170
|
|
|
/** |
|
171
|
|
|
* @param string $imageUrl |
|
172
|
|
|
* @return $this |
|
173
|
|
|
*/ |
|
174
|
1 |
|
public function setImageUrl($imageUrl) |
|
175
|
|
|
{ |
|
176
|
1 |
|
$this->imageUrl = $imageUrl; |
|
177
|
1 |
|
return $this; |
|
178
|
|
|
} |
|
179
|
|
|
|
|
180
|
|
|
/** |
|
181
|
|
|
* @return \DateTime |
|
182
|
|
|
*/ |
|
183
|
4 |
|
public function getDateCreated() |
|
184
|
|
|
{ |
|
185
|
4 |
|
return $this->dateCreated; |
|
186
|
|
|
} |
|
187
|
|
|
|
|
188
|
|
|
/** |
|
189
|
|
|
* @param \DateTime|string $dateCreated |
|
190
|
|
|
* @return $this |
|
191
|
|
|
*/ |
|
192
|
1 |
|
public function setDateCreated($dateCreated) |
|
193
|
|
|
{ |
|
194
|
1 |
|
$this->dateCreated = $this->parseWonnovaDateTime($dateCreated); |
|
195
|
1 |
|
return $this; |
|
196
|
|
|
} |
|
197
|
|
|
|
|
198
|
|
|
/** |
|
199
|
|
|
* @return Badge |
|
200
|
|
|
*/ |
|
201
|
4 |
|
public function getBadge() |
|
202
|
|
|
{ |
|
203
|
4 |
|
return $this->badge; |
|
204
|
|
|
} |
|
205
|
|
|
|
|
206
|
|
|
/** |
|
207
|
|
|
* @param mixed $badge |
|
208
|
|
|
* @return $this |
|
209
|
|
|
*/ |
|
210
|
1 |
|
public function setBadge($badge) |
|
211
|
|
|
{ |
|
212
|
1 |
|
$this->badge = $badge; |
|
213
|
1 |
|
return $this; |
|
214
|
|
|
} |
|
215
|
|
|
|
|
216
|
|
|
/** |
|
217
|
|
|
* @return Scenario |
|
218
|
|
|
*/ |
|
219
|
4 |
|
public function getScenario() |
|
220
|
|
|
{ |
|
221
|
4 |
|
return $this->scenario; |
|
222
|
|
|
} |
|
223
|
|
|
|
|
224
|
|
|
/** |
|
225
|
|
|
* @param mixed $scenario |
|
226
|
|
|
* @return $this |
|
227
|
|
|
*/ |
|
228
|
1 |
|
public function setScenario($scenario) |
|
229
|
|
|
{ |
|
230
|
1 |
|
$this->scenario = $scenario; |
|
231
|
1 |
|
return $this; |
|
232
|
|
|
} |
|
233
|
|
|
} |
|
234
|
|
|
|