Can cancel all the responses of a user to surveys.

This commit is contained in:
Pierre 2018-05-09 14:48:59 +02:00
parent 791ebad4eb
commit 334de7efe6

View File

@ -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
*