Code Duplication    Length = 7-7 lines in 2 locations

mod/gc_mobile_api/models/event.php 2 locations

@@ 113-119 (lines=7) @@
110
		'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'ASC', 'as' => 'integer'))
111
	);
112
113
	if ($from) {
114
		$params['metadata_name_value_pairs'][] = array(
115
			'name' => 'start_date',
116
			'value' => strtotime($from),
117
			'operand' => '>='
118
		);
119
	}
120
	if ($to) {
121
		$params['metadata_name_value_pairs'][] = array(
122
			'name' => 'end_date',
@@ 120-126 (lines=7) @@
117
			'operand' => '>='
118
		);
119
	}
120
	if ($to) {
121
		$params['metadata_name_value_pairs'][] = array(
122
			'name' => 'end_date',
123
			'value' => strtotime($to),
124
			'operand' => '<='
125
		);
126
	}
127
128
	$all_events = elgg_list_entities_from_metadata($params);
129
	$events = json_decode($all_events);