@@ 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 |
@@ 2199-2215 (lines=17) @@ | ||
2196 | return $ok; |
|
2197 | } |
|
2198 | ||
2199 | public function deleteJoin( $delTable, $joinTable, $delVar, $joinVar, $conds, |
|
2200 | $fname = __METHOD__ |
|
2201 | ) { |
|
2202 | if ( !$conds ) { |
|
2203 | throw new DBUnexpectedError( $this, __METHOD__ . ' called with empty $conds' ); |
|
2204 | } |
|
2205 | ||
2206 | $delTable = $this->tableName( $delTable ); |
|
2207 | $joinTable = $this->tableName( $joinTable ); |
|
2208 | $sql = "DELETE FROM $delTable WHERE $delVar IN (SELECT $joinVar FROM $joinTable "; |
|
2209 | if ( $conds != '*' ) { |
|
2210 | $sql .= 'WHERE ' . $this->makeList( $conds, self::LIST_AND ); |
|
2211 | } |
|
2212 | $sql .= ')'; |
|
2213 | ||
2214 | $this->query( $sql, $fname ); |
|
2215 | } |
|
2216 | ||
2217 | public function textFieldSize( $table, $field ) { |
|
2218 | $table = $this->tableName( $table ); |