| @@ -193,16 +193,25 @@ | ||
| 193 | 193 | return $this->wpdbAdapter->dbDelta( $createTableQuery, $this->wpdbAdapter->packeteryLog ); |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | 196 | /** |
| 197 | + * Drops log table. | |
| 198 | + * | |
| 199 | + * @return void | |
| 200 | + */ | |
| 201 | + public function drop(): void { | |
| 202 | + $this->wpdbAdapter->query( 'DROP TABLE IF EXISTS `' . $this->wpdbAdapter->packeteryLog . '`' ); | |
| 203 | + } | |
| 204 | + | |
| 205 | + /** | |
| 197 | 206 | * Save. |
| 198 | 207 | * |
| 199 | 208 | * @param Record $record Record. |
| 200 | 209 | * |
| 201 | - * @return int|false The number of rows updated, or false on error. | |
| 210 | + * @return void | |
| 202 | 211 | * @throws \Exception From DateTimeImmutable. |
| 203 | 212 | */ |
| 204 | - public function save( Record $record ) { | |
| 213 | + public function save( Record $record ): void { | |
| 205 | 214 | $date = $record->date; |
| 206 | 215 | if ( $date === null ) { |
| 207 | 216 | $date = CoreHelper::now(); |
| 208 | 217 | } |
| @@ -229,9 +238,9 @@ | ||
| 229 | 238 | 'params' => $paramsString, |
| 230 | 239 | 'date' => $dateString, |
| 231 | 240 | ]; |
| 232 | 241 | |
| 233 | - return $this->wpdbAdapter->insertReplaceHelper( $this->wpdbAdapter->packeteryLog, $data, null, 'REPLACE' ); | |
| 242 | + $this->wpdbAdapter->insertReplaceHelper( $this->wpdbAdapter->packeteryLog, $data, null, 'REPLACE' ); | |
| 234 | 243 | } |
| 235 | 244 | |
| 236 | 245 | /** |
| 237 | 246 | * Gets where clause for find and count queries. |