Code Duplication    Length = 15-17 lines in 2 locations

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

@@ 1111-1125 (lines=15) @@
1108
	 * @throws DBUnexpectedError
1109
	 * @return bool|ResultWrapper
1110
	 */
1111
	function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, $fname = __METHOD__ ) {
1112
		if ( !$conds ) {
1113
			throw new DBUnexpectedError( $this, __METHOD__ . ' called with empty $conds' );
1114
		}
1115
1116
		$delTable = $this->tableName( $delTable );
1117
		$joinTable = $this->tableName( $joinTable );
1118
		$sql = "DELETE $delTable FROM $delTable, $joinTable WHERE $delVar=$joinVar ";
1119
1120
		if ( $conds != '*' ) {
1121
			$sql .= ' AND ' . $this->makeList( $conds, self::LIST_AND );
1122
		}
1123
1124
		return $this->query( $sql, $fname );
1125
	}
1126
1127
	/**
1128
	 * @param string $table

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

@@ 2205-2221 (lines=17) @@
2202
		return $ok;
2203
	}
2204
2205
	public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds,
2206
		$fname = __METHOD__
2207
	) {
2208
		if ( !$conds ) {
2209
			throw new DBUnexpectedError( $this, __METHOD__ . ' called with empty $conds' );
2210
		}
2211
2212
		$delTable = $this->tableName( $delTable );
2213
		$joinTable = $this->tableName( $joinTable );
2214
		$sql = "DELETE FROM $delTable WHERE $delVar IN (SELECT $joinVar FROM $joinTable ";
2215
		if ( $conds != '*' ) {
2216
			$sql .= 'WHERE ' . $this->makeList( $conds, self::LIST_AND );
2217
		}
2218
		$sql .= ')';
2219
2220
		$this->query( $sql, $fname );
2221
	}
2222
2223
	public function textFieldSize( $table, $field ) {
2224
		$table = $this->tableName( $table );