Code Duplication    Length = 5-7 lines in 5 locations

engine/lib/deprecated-1.8.php 1 location

@@ 921-925 (lines=5) @@
918
		$where[] = "e.container_guid = {$container_guid}";
919
	}
920
921
	if (is_array($owner_guid)) {
922
		$where[] = "e.container_guid in (" . implode(",", $owner_guid) . ")";
923
	} else if ($owner_guid > 0) {
924
		$where[] = "e.container_guid = {$owner_guid}";
925
	}
926
927
	if (!$count) {
928
		$query = "SELECT distinct e.* ";

engine/lib/deprecated-1.9.php 1 location

@@ 1610-1614 (lines=5) @@
1607
		$where[] = "e.site_guid = {$site_guid}";
1608
	}
1609
1610
	if (is_array($owner_guid)) {
1611
		$where[] = "e.container_guid in (" . implode(",", $owner_guid) . ")";
1612
	} else if ($owner_guid > 0) {
1613
		$where[] = "e.container_guid = {$owner_guid}";
1614
	}
1615
1616
	// Add the calendar stuff
1617
	$cal_join = "

mod/event_calendar/models/model.php 3 locations

@@ 879-883 (lines=5) @@
876
		$where[] = "e.site_guid = {$site_guid}";
877
	}
878
	if ($filter) {
879
		if (is_array($owner_guid)) {
880
			$where[] = "ms.string in (".implode(",", $owner_guid).")";
881
		} else if ($owner_guid > 0) {
882
			$where[] = "ms.string = {$owner_guid}";
883
		}
884
885
		$where[] = "r.relationship = 'personal_event'";
886
	} else {
@@ 886-892 (lines=7) @@
883
		}
884
885
		$where[] = "r.relationship = 'personal_event'";
886
	} else {
887
		if (is_array($owner_guid)) {
888
			$where[] = "e.owner_guid in (".implode(",", $owner_guid).")";
889
		} else if ($owner_guid > 0) {
890
			$where[] = "e.owner_guid = {$owner_guid}";
891
		}
892
	}
893
894
	if (is_array($container_guid)) {
895
		$where[] = "e.container_guid in (".implode(",", $container_guid).")";
@@ 894-898 (lines=5) @@
891
		}
892
	}
893
894
	if (is_array($container_guid)) {
895
		$where[] = "e.container_guid in (".implode(",", $container_guid).")";
896
	} else if ($container_guid > 0) {
897
		$where[] = "e.container_guid = {$container_guid}";
898
	}
899
900
	if (!$count) {
901
		$query = "SELECT distinct e.* ";