Code Duplication    Length = 12-12 lines in 2 locations

mod/elgg_solr/lib/functions.php 2 locations

@@ 449-460 (lines=12) @@
446
		}
447
	}
448
449
	if ($params['types'] && $params['types'] !== ELGG_ENTITIES_ANY_VALUE) {
450
		if (is_array($params['types'])) {
451
			$fq['type'] = 'type:(' . implode(' OR ', $params['types']) . ')';
452
		} else {
453
			if ($params['types'] === ELGG_ENTITIES_NO_VALUE) {
454
				//$fq['type'] = '-type:[* TO *]';
455
				$fq['type'] = 'type:""';
456
			} else {
457
				$fq['type'] = 'type:' . $params['types'];
458
			}
459
		}
460
	}
461
462
	//subtype
463
	if (isset($params['subtype']) && $params['subtype'] !== ELGG_ENTITIES_ANY_VALUE) {
@@ 472-483 (lines=12) @@
469
		}
470
	}
471
472
	if (isset($params['subtypes']) && $params['subtypes'] !== ELGG_ENTITIES_ANY_VALUE) {
473
		if (is_array($params['subtypes'])) {
474
			$fq['subtype'] = 'subtype:(' . implode(' OR ', $params['subtypes']) . ')';
475
		} else {
476
			if ($params['subtypes'] === ELGG_ENTITIES_NO_VALUE) {
477
				//$fq['subtype'] = '-subtype:[* TO *]';
478
				$fq['subtype'] = 'subtype:""';
479
			} else {
480
				$fq['subtype'] = 'subtype:' . $params['subtypes'];
481
			}
482
		}
483
	}
484
485
486
	//container