Code Duplication    Length = 15-17 lines in 2 locations

includes/libs/rdbms/database/DatabaseMysqlBase.php 1 location

@@ 1101-1115 (lines=15) @@
1098
	 * @throws DBUnexpectedError
1099
	 * @return bool|ResultWrapper
1100
	 */
1101
	function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = __METHOD__ ) {
1102
		if ( !$conds ) {
1103
			throw new DBUnexpectedError( $this, __METHOD__ . ' called with empty $conds' );
1104
		}
1105
1106
		$delTable = $this->tableName( $delTable );
1107
		$joinTable = $this->tableName( $joinTable );
1108
		$sql = "DELETE $delTable FROM $delTable, $joinTable WHERE $delVar=$joinVar ";
1109
1110
		if ( $conds != '*' ) {
1111
			$sql .= ' AND ' . $this->makeList( $conds, self::LIST_AND );
1112
		}
1113
1114
		return $this->query( $sql, $fname );
1115
	}
1116
1117
	/**
1118
	 * @param string $table

includes/libs/rdbms/database/Database.php 1 location

@@ 2182-2198 (lines=17) @@
2179
		return $ok;
2180
	}
2181
2182
	public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds,
2183
		$fname = __METHOD__
2184
	) {
2185
		if ( !$conds ) {
2186
			throw new DBUnexpectedError( $this, __METHOD__ . ' called with empty $conds' );
2187
		}
2188
2189
		$delTable = $this->tableName( $delTable );
2190
		$joinTable = $this->tableName( $joinTable );
2191
		$sql = "DELETE FROM $delTable WHERE $delVar IN (SELECT $joinVar FROM $joinTable ";
2192
		if ( $conds != '*' ) {
2193
			$sql .= 'WHERE ' . $this->makeList( $conds, self::LIST_AND );
2194
		}
2195
		$sql .= ')';
2196
2197
		$this->query( $sql, $fname );
2198
	}
2199
2200
	public function textFieldSize( $table, $field ) {
2201
		$table = $this->tableName( $table );