mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 00:25:18 +00:00
Can get all the response of a user to a survey into a SurveyResponse object
This commit is contained in:
@ -131,4 +131,24 @@ class SurveysController {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Turn a SurveyResponse object into API array
|
||||
*
|
||||
* @param SurveyResponse $response The response to convert
|
||||
* @return array Generated API entry
|
||||
*/
|
||||
public static function SurveyResponseToAPI(SurveyResponse $response) : array {
|
||||
|
||||
$data = array();
|
||||
|
||||
$data["id"] = $response->get_id();
|
||||
$data["time_sent"] = $response->get_time_sent();
|
||||
$data["userID"] = $response->get_userID();
|
||||
$data["surveyID"] = $response->get_surveyID();
|
||||
$data["choiceID"] = $response->get_choiceID();
|
||||
|
||||
return $data;
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user