public function deleteUser(int $userId) : bool
{
$this->db->beginTransaction();
// To avoid deleting files unnecessarily...
$this->db->update('airship_files', ['uploaded_by' => null], ['uploaded_by' => $userId]);
// Cascade-delete all foreign keys:
$this->deleteUserCascade($userId);
// Actually delete the user account:
$this->db->delete('airship_users', ['userid' => $userId]);
// And finally...
return $this->db->commit();
}