Code Duplication    Length = 9-9 lines in 2 locations

lib/private/DB/AdapterSqlite.php 1 location

@@ 73-81 (lines=9) @@
70
			. " WHERE NOT EXISTS (SELECT 1 FROM `$table` WHERE ";
71
72
		$inserts = array_values($input);
73
		foreach($compare as $key) {
74
			$query .= '`' . $key . '`';
75
			if (is_null($input[$key])) {
76
				$query .= ' IS NULL AND ';
77
			} else {
78
				$inserts[] = $input[$key];
79
				$query .= ' = ? AND ';
80
			}
81
		}
82
		$query = substr($query, 0, strlen($query) - 5);
83
		$query .= ')';
84

lib/private/DB/Adapter.php 1 location

@@ 105-113 (lines=9) @@
102
			. 'FROM `' . $table . '` WHERE ';
103
104
		$inserts = array_values($input);
105
		foreach ($compare as $key) {
106
			$query .= '`' . $key . '`';
107
			if (is_null($input[$key])) {
108
				$query .= ' IS NULL AND ';
109
			} else {
110
				$inserts[] = $input[$key];
111
				$query .= ' = ? AND ';
112
			}
113
		}
114
		$query = substr($query, 0, strlen($query) - 5);
115
		$query .= ' HAVING COUNT(*) = 0';
116
		return $this->conn->executeUpdate($query, $inserts);