LimeSurvey API - Master branch

SubQuestionsService
in package
Uses ValidateTrait

Question Aggregate Service

Service class for editing question data.

Dependencies are injected to enable mocking.

Table of Contents

Properties

$l10nService  : L10nService
$modelQuestion  : Question

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

Methods

validateCodes()

Validate subquestion/answer codes.

public validateCodes(array<string|int, mixed> $requestDataArray) : void
Parameters
$requestDataArray : array<string|int, mixed>

Data from request.

Tags
throws
PersistErrorException

deleteSubquestion()

Deletes a subquestion.

private deleteSubquestion(int $surveyId, int $subQuestionId) : mixed
Parameters
$surveyId : int
$subQuestionId : int
Tags
throws
NotFoundException|CDbException

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
throws
PersistErrorException
throws
BadRequestException
SuppressWarnings

(PHPMD.ExcessiveMethodLength)

Return values
Question

storeSubquestions()

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
throws
PersistErrorException
throws
BadRequestException

        
On this page

Search results