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

@@ 851-855 (lines=5) @@
848
		$where[] = "e.site_guid = {$site_guid}";
849
	}
850
	if ($filter) {
851
		if (is_array($owner_guid)) {
852
			$where[] = "ms.string in (".implode(",", $owner_guid).")";
853
		} else if ($owner_guid > 0) {
854
			$where[] = "ms.string = {$owner_guid}";
855
		}
856
857
		$where[] = "r.relationship = 'personal_event'";
858
	} else {
@@ 858-864 (lines=7) @@
855
		}
856
857
		$where[] = "r.relationship = 'personal_event'";
858
	} else {
859
		if (is_array($owner_guid)) {
860
			$where[] = "e.owner_guid in (".implode(",", $owner_guid).")";
861
		} else if ($owner_guid > 0) {
862
			$where[] = "e.owner_guid = {$owner_guid}";
863
		}
864
	}
865
866
	if (is_array($container_guid)) {
867
		$where[] = "e.container_guid in (".implode(",", $container_guid).")";
@@ 866-870 (lines=5) @@
863
		}
864
	}
865
866
	if (is_array($container_guid)) {
867
		$where[] = "e.container_guid in (".implode(",", $container_guid).")";
868
	} else if ($container_guid > 0) {
869
		$where[] = "e.container_guid = {$container_guid}";
870
	}
871
872
	if (!$count) {
873
		$query = "SELECT distinct e.* ";