mirror of
				https://github.com/pierre42100/ComunicAPI
				synced 2025-11-03 19:54:14 +00:00 
			
		
		
		
	Can cancel all the responses of a user to surveys.
This commit is contained in:
		@@ -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
 | 
			
		||||
	 * 
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user