@@ -33,19 +33,10 @@ public function getStatsByTypeCode($typeCode)
33
33
{
34
34
$ stats = array ();
35
35
foreach ($ this ->data as $ statistic ) {
36
- $ statcat_type = $ statistic ->category_type ;
37
- $ statcat_cat = $ statistic ->statistic_category ;
38
- $ statcat_note = $ statistic ->statistic_note ;
39
- $ segment_type = $ statistic ->segment_type ;
40
-
41
- $ type_code = $ statcat_type ->value ;
42
- $ type_desc = $ statcat_type ->desc ;
43
- $ category_code = $ statcat_cat ->value ;
44
- $ category_desc = $ statcat_cat ->desc ;
45
-
46
- if ($ type_code == $ typeCode ) {
36
+ if ($ statistic ->category_type ->value == $ typeCode ) {
47
37
array_push ($ stats ,$ statistic );
48
38
}
39
+
49
40
}
50
41
return $ stats ;
51
42
}
@@ -59,17 +50,7 @@ public function getStatsByTypeDesc($typeDesc)
59
50
{
60
51
$ stats = array ();
61
52
foreach ($ this ->data as $ statistic ) {
62
- $ statcat_type = $ statistic ->category_type ;
63
- $ statcat_cat = $ statistic ->statistic_category ;
64
- $ statcat_note = $ statistic ->statistic_note ;
65
- $ segment_type = $ statistic ->segment_type ;
66
-
67
- $ type_code = $ statcat_type ->value ;
68
- $ type_desc = $ statcat_type ->desc ;
69
- $ category_code = $ statcat_cat ->value ;
70
- $ category_desc = $ statcat_cat ->desc ;
71
-
72
- if ($ type_desc == $ typeDesc ) {
53
+ if ($ statistic ->category_type ->desc == $ typeDesc ) {
73
54
array_push ($ stats ,$ statistic );
74
55
}
75
56
}
@@ -85,17 +66,7 @@ public function getStatsByCategoryCode($categoryCode)
85
66
{
86
67
$ stats = array ();
87
68
foreach ($ this ->data as $ statistic ) {
88
- $ statcat_type = $ statistic ->category_type ;
89
- $ statcat_cat = $ statistic ->statistic_category ;
90
- $ statcat_note = $ statistic ->statistic_note ;
91
- $ segment_type = $ statistic ->segment_type ;
92
-
93
- $ type_code = $ statcat_type ->value ;
94
- $ type_desc = $ statcat_type ->desc ;
95
- $ category_code = $ statcat_cat ->value ;
96
- $ category_desc = $ statcat_cat ->desc ;
97
-
98
- if ($ category_code == $ categoryCode ) {
69
+ if ($ statistic ->statistic_category ->value == $ categoryCode ) {
99
70
array_push ($ stats ,$ statistic );
100
71
}
101
72
}
@@ -111,17 +82,7 @@ public function getStatsByCategoryDesc($categoryDesc)
111
82
{
112
83
$ stats = array ();
113
84
foreach ($ this ->data as $ statistic ) {
114
- $ statcat_type = $ statistic ->category_type ;
115
- $ statcat_cat = $ statistic ->statistic_category ;
116
- $ statcat_note = $ statistic ->statistic_note ;
117
- $ segment_type = $ statistic ->segment_type ;
118
-
119
- $ type_code = $ statcat_type ->value ;
120
- $ type_desc = $ statcat_type ->desc ;
121
- $ category_code = $ statcat_cat ->value ;
122
- $ category_desc = $ statcat_cat ->desc ;
123
-
124
- if ($ category_desc == $ categoryDesc ) {
85
+ if ($ statistic ->statistic_category ->desc == $ categoryDesc ) {
125
86
array_push ($ stats ,$ statistic );
126
87
}
127
88
}
@@ -137,17 +98,7 @@ public function getStatsBySegmentType($segmentType)
137
98
{
138
99
$ stats = array ();
139
100
foreach ($ this ->data as $ statistic ) {
140
- $ statcat_type = $ statistic ->category_type ;
141
- $ statcat_cat = $ statistic ->statistic_category ;
142
- $ statcat_note = $ statistic ->statistic_note ;
143
- $ segment_type = $ statistic ->segment_type ;
144
-
145
- $ type_code = $ statcat_type ->value ;
146
- $ type_desc = $ statcat_type ->desc ;
147
- $ category_code = $ statcat_cat ->value ;
148
- $ category_desc = $ statcat_cat ->desc ;
149
-
150
- if ($ segment_type == $ segmentType ) {
101
+ if ($ statistic ->segment_type == $ segmentType ) {
151
102
array_push ($ stats ,$ statistic );
152
103
}
153
104
}
@@ -163,17 +114,7 @@ public function searchStatsByNote($note)
163
114
{
164
115
$ stats = array ();
165
116
foreach ($ this ->data as $ statistic ) {
166
- $ statcat_type = $ statistic ->category_type ;
167
- $ statcat_cat = $ statistic ->statistic_category ;
168
- $ statcat_note = $ statistic ->statistic_note ;
169
- $ segment_type = $ statistic ->segment_type ;
170
-
171
- $ type_code = $ statcat_type ->value ;
172
- $ type_desc = $ statcat_type ->desc ;
173
- $ category_code = $ statcat_cat ->value ;
174
- $ category_desc = $ statcat_cat ->desc ;
175
-
176
- if (preg_match ("/ $ note/i " , $ statcat_note )) {
117
+ if (preg_match ("/ $ note/i " , $ statistic ->statistic_note )) {
177
118
array_push ($ stats ,$ statistic );
178
119
}
179
120
}
@@ -189,17 +130,7 @@ public function searchStatsByTypeCode($typeCode)
189
130
{
190
131
$ stats = array ();
191
132
foreach ($ this ->data as $ statistic ) {
192
- $ statcat_type = $ statistic ->category_type ;
193
- $ statcat_cat = $ statistic ->statistic_category ;
194
- $ statcat_note = $ statistic ->statistic_note ;
195
- $ segment_type = $ statistic ->segment_type ;
196
-
197
- $ type_code = $ statcat_type ->value ;
198
- $ type_desc = $ statcat_type ->desc ;
199
- $ category_code = $ statcat_cat ->value ;
200
- $ category_desc = $ statcat_cat ->desc ;
201
-
202
- if (preg_match ("/ $ typeCode/i " , $ type_code )) {
133
+ if (preg_match ("/ $ typeCode/i " , $ statistic ->category_type ->value )) {
203
134
array_push ($ stats ,$ statistic );
204
135
}
205
136
}
@@ -215,17 +146,7 @@ public function searchStatsByTypeDesc($typeDesc)
215
146
{
216
147
$ stats = array ();
217
148
foreach ($ this ->data as $ statistic ) {
218
- $ statcat_type = $ statistic ->category_type ;
219
- $ statcat_cat = $ statistic ->statistic_category ;
220
- $ statcat_note = $ statistic ->statistic_note ;
221
- $ segment_type = $ statistic ->segment_type ;
222
-
223
- $ type_code = $ statcat_type ->value ;
224
- $ type_desc = $ statcat_type ->desc ;
225
- $ category_code = $ statcat_cat ->value ;
226
- $ category_desc = $ statcat_cat ->desc ;
227
-
228
- if (preg_match ("/ $ typeDesc/i " , $ type_desc )) {
149
+ if (preg_match ("/ $ typeDesc/i " , $ statistic ->category_type ->desc )) {
229
150
array_push ($ stats ,$ statistic );
230
151
}
231
152
}
@@ -241,17 +162,7 @@ public function searchStatsByCategoryCode($categoryCode)
241
162
{
242
163
$ stats = array ();
243
164
foreach ($ this ->data as $ statistic ) {
244
- $ statcat_type = $ statistic ->category_type ;
245
- $ statcat_cat = $ statistic ->statistic_category ;
246
- $ statcat_note = $ statistic ->statistic_note ;
247
- $ segment_type = $ statistic ->segment_type ;
248
-
249
- $ type_code = $ statcat_type ->value ;
250
- $ type_desc = $ statcat_type ->desc ;
251
- $ category_code = $ statcat_cat ->value ;
252
- $ category_desc = $ statcat_cat ->desc ;
253
-
254
- if (preg_match ("/ $ categoryCode/i " , $ category_code )) {
165
+ if (preg_match ("/ $ categoryCode/i " , $ statistic ->statistic_category ->value )) {
255
166
array_push ($ stats ,$ statistic );
256
167
}
257
168
}
@@ -267,37 +178,11 @@ public function searchStatsByCategoryDesc($categoryDesc)
267
178
{
268
179
$ stats = array ();
269
180
foreach ($ this ->data as $ statistic ) {
270
- $ statcat_type = $ statistic ->category_type ;
271
- $ statcat_cat = $ statistic ->statistic_category ;
272
- $ statcat_note = $ statistic ->statistic_note ;
273
- $ segment_type = $ statistic ->segment_type ;
274
-
275
- $ type_code = $ statcat_type ->value ;
276
- $ type_desc = $ statcat_type ->desc ;
277
- $ category_code = $ statcat_cat ->value ;
278
- $ category_desc = $ statcat_cat ->desc ;
279
-
280
- if (preg_match ("/ $ categoryDesc/i " , $ category_desc )) {
181
+ if (preg_match ("/ $ categoryDesc/i " , $ statistic ->statistic_category ->desc )) {
281
182
array_push ($ stats ,$ statistic );
282
183
}
283
184
}
284
185
return $ stats ;
285
186
}
286
187
287
-
288
-
289
- /*
290
- public function all($status = 'ACTIVE')
291
- {
292
- $ids = [$this->data->primary_id];
293
- foreach ($this->data->user_identifier as $identifier) {
294
- if (is_null($status) || $identifier->status == $status) {
295
- $ids[] = $identifier->value;
296
- }
297
- }
298
-
299
- return $ids;
300
- }
301
- */
302
-
303
188
}
0 commit comments