Update AuditTrailRepository to improve user handling and fix nullable user type in AuditTrail

- Changed `getUser` method in `AuditTrail` to allow null values by updating the return type to `?User`.
- Updated `insert` method in `AuditTrailRepository` to handle nullable users, ensuring the `user_id` parameter is set only when applicable.
- Improved code robustness by adding null-check logic for user assignment in the SQL query.
This commit is contained in:
2026-01-28 22:35:13 +01:00
parent c1a0234358
commit 54e2777fa2
2 changed files with 7 additions and 3 deletions

View File

@@ -54,7 +54,7 @@ class AuditTrail
return $this->id;
}
public function getUser(): User
public function getUser(): ?User
{
return $this->user;
}