Code Duplication    Length = 7-7 lines in 2 locations

mod/gc_mobile_api/models/event.php 2 locations

@@ 127-133 (lines=7) @@
124
		'order_by_metadata' => array(array('name' => 'start_date', 'direction' => 'DESC', 'as' => 'integer'))
125
	);
126
127
	if ($from) {
128
		$params['metadata_name_value_pairs'][] = array(
129
			'name' => 'start_date',
130
			'value' => strtotime($from),
131
			'operand' => '>='
132
		);
133
	}
134
	if ($to) {
135
		$params['metadata_name_value_pairs'][] = array(
136
			'name' => 'end_date',
@@ 134-140 (lines=7) @@
131
			'operand' => '>='
132
		);
133
	}
134
	if ($to) {
135
		$params['metadata_name_value_pairs'][] = array(
136
			'name' => 'end_date',
137
			'value' => strtotime($to),
138
			'operand' => '<='
139
		);
140
	}
141
142
	$all_events = elgg_list_entities_from_metadata($params);
143
	$events = json_decode($all_events);