AnswersService
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
- save() : void
- Based on QuestionAdministrationController::actionSaveQuestionData()
- validateCodes() : void
- Validate subquestion/answer codes.
- storeAnswerL10n() : void
- Store new answer L10n
- storeAnswerOption() : int
- Stores a single answer.
- storeAnswerOptions() : void
- Store new answer options.
Properties
$modelAnswer
private
Answer
$modelAnswer
$modelAnswerL10n
private
AnswerL10n
$modelAnswerL10n
Methods
__construct()
public
__construct(Answer $modelAnswer, AnswerL10n $modelAnswerL10n) : mixed
Parameters
- $modelAnswer : Answer
- $modelAnswerL10n : AnswerL10n
save()
Based on QuestionAdministrationController::actionSaveQuestionData()
public
save(Question $question, $answerOptions) : void
Parameters
- $question : Question
- $answerOptions :
Tags
validateCodes()
Validate subquestion/answer codes.
public
validateCodes(array<string|int, mixed> $requestDataArray) : void
Parameters
- $requestDataArray : array<string|int, mixed>
-
Data from request.
Tags
storeAnswerL10n()
Store new answer L10n
private
storeAnswerL10n(Answer $answer, string $language, string $text) : void
Parameters
- $answer : Answer
- $language : string
- $text : string
Tags
storeAnswerOption()
Stores a single answer.
private
storeAnswerOption(Question $question, $answerId, array<string|int, mixed> $optionArray, int &$count) : int
Different from update during active survey?
Parameters
- $question : Question
- $answerId :
- $optionArray : array<string|int, mixed>
- $count : int
Tags
Return values
intstoreAnswerOptions()
Store new answer options.
private
storeAnswerOptions(Question $question, array<string|int, mixed> $optionsArray) : void
Different from update during active survey?
Parameters
- $question : Question
- $optionsArray : array<string|int, mixed>