Code Duplication    Length = 7-7 lines in 3 locations

Ubiquity/db/SqlUtils.php 3 locations

@@ 31-37 (lines=7) @@
28
		return $ret;
29
	}
30
31
	public static function getWhere($keyAndValues, $quote="`") {
32
		$ret=array ();
33
		foreach ( $keyAndValues as $key => $value ) {
34
			$ret[]=$quote . $key . $quote . "= :" . $key;
35
		}
36
		return implode(" AND ", $ret);
37
	}
38
39
	public static function getMultiWhere($values, $field, $quote="`") {
40
		$ret=array ();
@@ 39-45 (lines=7) @@
36
		return implode(" AND ", $ret);
37
	}
38
39
	public static function getMultiWhere($values, $field, $quote="`") {
40
		$ret=array ();
41
		foreach ( $values as $value ) {
42
			$ret[]=$quote . $field . $quote . "='" . $value . "'";
43
		}
44
		return implode(" OR ", $ret);
45
	}
46
47
	public static function getInsertFields($keyAndValues) {
48
		return implode(",", self::getQuotedKeys($keyAndValues));
@@ 55-61 (lines=7) @@
52
		return implode(",", self::getParameters($keyAndValues));
53
	}
54
55
	public static function getUpdateFieldsKeyAndValues($keyAndValues, $quote="`") {
56
		$ret=array ();
57
		foreach ( $keyAndValues as $key => $value ) {
58
			$ret[]=$quote . $key . $quote . "= :" . $key;
59
		}
60
		return implode(",", $ret);
61
	}
62
63
	public static function checkWhere($condition){
64
		$c=\strtolower($condition);