diff --git a/classes/components/SurveyComponent.php b/classes/components/SurveyComponent.php index 10432b7..dd37240 100644 --- a/classes/components/SurveyComponent.php +++ b/classes/components/SurveyComponent.php @@ -175,6 +175,20 @@ class SurveyComponent { array($surveyID, $userID)); } + /** + * Cancel all the responses of a user + * + * @param int $userID The ID of the target user + * @return bool TRUE for a success / FALSE else + */ + public function cancel_all_user_responses(int $userID) : bool { + //Perform a request on the database + return CS::get()->db->deleteEntry( + $this::SURVEY_RESPONSE_TABLE, + "ID_utilisateurs = ?", + array($userID)); + } + /** * Delete the survey associated to a post *