| @@ -289,19 +289,20 @@ | ||
| 289 | 289 | |
| 290 | 290 | /** |
| 291 | 291 | * Mass insert logs, usually fetched from API. |
| 292 | 292 | * |
| 293 | - * @param array $data An array of data to be inserted into the Audit_Log table. | |
| 293 | + * @param array $data An array of data to be inserted into the Audit_Log table. | |
| 294 | + * @param int $synced Whether the logs have already been synced. | |
| 294 | 295 | * |
| 295 | 296 | * @return void |
| 296 | 297 | * @throws ReflectionException If the import method of the Audit_Log class throws a ReflectionException. |
| 297 | 298 | */ |
| 298 | - public static function mass_insert( $data ) { | |
| 299 | + public static function mass_insert( $data, $synced = 1 ) { | |
| 299 | 300 | // Use raw sql for faster. |
| 300 | 301 | foreach ( $data as $datum ) { |
| 301 | 302 | $item = new Audit_Log(); |
| 302 | 303 | $item->import( $datum ); |
| 303 | - $item->synced = 1; | |
| 304 | + $item->synced = $synced; | |
| 304 | 305 | $item->save(); |
| 305 | 306 | } |
| 306 | 307 | } |
| 307 | 308 | |