mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-10-12 15:04:04 +00:00
removed direct use of retval from all CoodleSurvey_model methods
This commit is contained in:
@@ -161,7 +161,8 @@ class CoodleSurvey extends FHCAPI_Controller
|
||||
public function getActiveSurveys()
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
$activeSurveys = $this->CoodleSurveyModel->getActiveSurveys($uid);
|
||||
$activeSurveysResult = $this->CoodleSurveyModel->getActiveSurveys($uid);
|
||||
$activeSurveys = $this->getDataOrTerminateWithError($activeSurveysResult);
|
||||
$activeSurveys = array_map(
|
||||
function ($survey) {
|
||||
$survey->creator = [
|
||||
@@ -180,7 +181,8 @@ class CoodleSurvey extends FHCAPI_Controller
|
||||
public function getInactiveSurveys()
|
||||
{
|
||||
$uid = getAuthUID();
|
||||
$inactiveSurveys = $this->CoodleSurveyModel->getInactiveSurveys($uid);
|
||||
$inactiveSurveysResult = $this->CoodleSurveyModel->getInactiveSurveys($uid);
|
||||
$inactiveSurveys = $this->getDataOrTerminateWithError($inactiveSurveysResult);
|
||||
$inactiveSurveys = array_map(
|
||||
function ($survey) {
|
||||
$survey->creator = [
|
||||
@@ -215,7 +217,7 @@ class CoodleSurvey extends FHCAPI_Controller
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$surveyId = getData($this->CoodleSurveyModel->createSurvey($surveyData, getAuthUID()));
|
||||
$surveyId = $this->getDataOrTerminateWithError($this->CoodleSurveyModel->createSurvey($surveyData, getAuthUID()));
|
||||
$this->CoodleSurveyTimeslotModel->updateTimeslots($surveyId, $surveyData["timeslots"]);
|
||||
$timeslots = $this->CoodleSurveyTimeslotModel->getTimeslots($surveyId);
|
||||
$this->CoodleSurveyParticipantModel->updateParticipants($surveyId, $surveyData["participants"], $timeslots);
|
||||
|
||||
@@ -33,7 +33,7 @@ class CoodleSurvey_model extends DB_Model
|
||||
FROM $this->dbTable
|
||||
WHERE id IN $surveyIds
|
||||
";
|
||||
return $this->execQuery($query)->retval;
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
public function getActiveSurveys($uid)
|
||||
@@ -65,7 +65,7 @@ class CoodleSurvey_model extends DB_Model
|
||||
AND completed_at IS NULL
|
||||
AND canceled_at IS NULL";
|
||||
|
||||
return $this->execQuery($query)->retval;
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
public function getInactiveSurveys($uid)
|
||||
@@ -97,7 +97,7 @@ class CoodleSurvey_model extends DB_Model
|
||||
$query .= "creator_uid = '$uid')
|
||||
AND (completed_at IS NOT NULL OR canceled_at IS NOT NULL)";
|
||||
|
||||
return $this->execQuery($query)->retval;
|
||||
return $this->execQuery($query);
|
||||
}
|
||||
|
||||
public function createSurvey($surveyData, $creatorUid)
|
||||
@@ -122,7 +122,7 @@ class CoodleSurvey_model extends DB_Model
|
||||
return error('Something went wrong during survey creation!');
|
||||
}
|
||||
|
||||
return success($surveyCreationResult->retval);
|
||||
return $surveyCreationResult;
|
||||
}
|
||||
|
||||
public function updateSurvey($surveyId, $surveyData)
|
||||
@@ -142,7 +142,7 @@ class CoodleSurvey_model extends DB_Model
|
||||
return error('Something went wrong during survey update!');
|
||||
}
|
||||
|
||||
return success($surveyUpdateResult->retval);
|
||||
return $surveyUpdateResult;
|
||||
}
|
||||
|
||||
public function cancelSurvey($surveyId)
|
||||
|
||||
Reference in New Issue
Block a user