Code Duplication    Length = 7-7 lines in 3 locations

mod/gc_mobile_api/models/event.php 3 locations

@@ 236-242 (lines=7) @@
233
			'operand' => '>='
234
		);
235
	}
236
	if ($to) {
237
		$params['metadata_name_value_pairs'][] = array(
238
			'name' => 'end_date',
239
			'value' => strtotime($to),
240
			'operand' => '<='
241
		);
242
	}
243
244
	$all_events = elgg_list_entities_from_metadata($params);
245
	$events = json_decode($all_events);
@@ 343-349 (lines=7) @@
340
			'operand' => '>='
341
		);
342
	}
343
	if ($to) {
344
		$params['metadata_name_value_pairs'][] = array(
345
			'name' => 'end_date',
346
			'value' => strtotime($to),
347
			'operand' => '<='
348
		);
349
	}
350
351
	$all_events = elgg_list_entities_from_relationship($params);
352
@@ 443-449 (lines=7) @@
440
				'operand' => '>='
441
			);
442
		}
443
		if ($to) {
444
			$params['metadata_name_value_pairs'][] = array(
445
				'name' => 'end_date',
446
				'value' => strtotime($to),
447
				'operand' => '<='
448
			);
449
		}
450
451
		$all_events = elgg_list_entities_from_metadata($params);
452
		$events = json_decode($all_events);