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