Code Duplication    Length = 7-7 lines in 2 locations

mod/gc_mobile_api/models/event.php 2 locations

@@ 214-220 (lines=7) @@
211
			'value' => strtotime($from),
212
			'operand' => '>='
213
		);
214
	} else {
215
		$params['metadata_name_value_pairs'][] = array(
216
			'name' => 'end_date',
217
			'value' => $now,
218
			'operand' => '>='
219
		);
220
	}
221
	if ($to) {
222
		$params['metadata_name_value_pairs'][] = array(
223
			'name' => 'end_date',
@@ 221-227 (lines=7) @@
218
			'operand' => '>='
219
		);
220
	}
221
	if ($to) {
222
		$params['metadata_name_value_pairs'][] = array(
223
			'name' => 'end_date',
224
			'value' => strtotime($to),
225
			'operand' => '<='
226
		);
227
	}
228
229
	$all_events = elgg_list_entities_from_metadata($params);
230
	$events = json_decode($all_events);