SubQuestionsService
in package
Uses
ValidateTrait
Question Aggregate Service
Service class for editing question data.
Dependencies are injected to enable mocking.
Table of Contents
Properties
Methods
- __construct() : mixed
- delete() : mixed
- Deletes a subquestion.
- save() : void
- Based on QuestionAdministrationController::actionSaveQuestionData()
- validateCodes() : void
- Validate subquestion/answer codes.
- deleteSubquestion() : mixed
- Deletes a subquestion.
- storeSubquestion() : Question
- Save subquestion.
- storeSubquestions() : void
- Save subquestions.
- updateSubquestionL10nService() : void
- Save subquestion L10nService
Properties
$l10nService
private
L10nService
$l10nService
$modelQuestion
private
Question
$modelQuestion
Methods
__construct()
public
__construct(L10nService $l10nService, Question $modelQuestion) : mixed
Parameters
- $l10nService : L10nService
- $modelQuestion : Question
delete()
Deletes a subquestion.
public
delete(int $surveyId, int $subquestionId) : mixed
Parameters
- $surveyId : int
- $subquestionId : int
Tags
save()
Based on QuestionAdministrationController::actionSaveQuestionData()
public
save(Question $question, mixed $subquestions) : void
Parameters
- $question : Question
- $subquestions : mixed
Tags
validateCodes()
Validate subquestion/answer codes.
public
validateCodes(array<string|int, mixed> $requestDataArray) : void
Parameters
- $requestDataArray : array<string|int, mixed>
-
Data from request.
Tags
deleteSubquestion()
Deletes a subquestion.
private
deleteSubquestion(int $surveyId, int $subQuestionId) : mixed
Parameters
- $surveyId : int
- $subQuestionId : int
Tags
storeSubquestion()
Save subquestion.
private
storeSubquestion(Question $question, int $subquestionId, int $scaleId, array<string|int, mixed> $data, int &$questionOrder[, bool $surveyActive = false ]) : Question
Used when survey is not activated.
Parameters
- $question : Question
- $subquestionId : int
- $scaleId : int
- $data : array<string|int, mixed>
- $questionOrder : int
- $surveyActive : bool = false
Tags
Return values
QuestionstoreSubquestions()
Save subquestions.
private
storeSubquestions(Question $question, array<string|int, mixed> $subquestionsArray[, bool $surveyActive = false ]) : void
Used when survey is not activated.
Parameters
- $question : Question
- $subquestionsArray : array<string|int, mixed>
- $surveyActive : bool = false
Tags
updateSubquestionL10nService()
Save subquestion L10nService
private
updateSubquestionL10nService(Question $subquestion, array<string|int, mixed> $data) : void
Parameters
- $subquestion : Question
- $data : array<string|int, mixed>