Code Duplication    Length = 4-4 lines in 3 locations

mod/gc_mobile_api/inc/functions.php 3 locations

@@ 266-269 (lines=4) @@
263
				if ($object == "group") {
264
					$params['joins'] = array("JOIN {$db_prefix}groups_entity ge ON e.guid = ge.guid");
265
					$params['wheres'] = array("(ge.name LIKE '%" . $query . "%' OR ge.description LIKE '%" . $query . "%')");
266
				} else {
267
					$params['joins'] = array("JOIN {$db_prefix}objects_entity oe ON e.guid = oe.guid");
268
					$params['wheres'] = array("(oe.title LIKE '%" . $query . "%' OR oe.description LIKE '%" . $query . "%')");
269
				}
270
			}
271
272
			if ($group) {
@@ 276-279 (lines=4) @@
273
				$params['container_guid'] = $group;
274
			}
275
276
			if ($from_date) {
277
				$params['joins'] = array("JOIN {$db_prefix}entities fd ON e.guid = fd.guid");
278
				$params['wheres'] = array("(fd.time_updated >= " . strtotime($from_date) . ")");
279
			}
280
			if ($to_date) {
281
				$params['joins'] = array("JOIN {$db_prefix}entities td ON e.guid = td.guid");
282
				$params['wheres'] = array("(td.time_updated <= " . strtotime($to_date) . ")");
@@ 280-283 (lines=4) @@
277
				$params['joins'] = array("JOIN {$db_prefix}entities fd ON e.guid = fd.guid");
278
				$params['wheres'] = array("(fd.time_updated >= " . strtotime($from_date) . ")");
279
			}
280
			if ($to_date) {
281
				$params['joins'] = array("JOIN {$db_prefix}entities td ON e.guid = td.guid");
282
				$params['wheres'] = array("(td.time_updated <= " . strtotime($to_date) . ")");
283
			}
284
285
			$ia = elgg_set_ignore_access(true);
286
			$data = json_decode(elgg_list_entities_from_metadata($params));