LimeSurvey API - Master branch

AttributesService
in package

Question Aggregate Attributes Service

Service class for editing question attributes data.

Based on QuestionAdministrationController::unparseAndSetAdvancedOptions()

Table of Contents

Properties

$modelQuestionAttribute  : QuestionAttribute
$modelSurvey  : Survey
$questionAttributeHelper  : QuestionAttributeHelper

Methods

__construct()  : mixed
sanitizeAttributesByType()  : void
Removes question attributes from the database that are not valid for the question's current type. This prevents orphaned attributes from a previous question type from interfering with the current type.
save()  : void
Saves the base attributes of questions as they come in
saveAdvanced()  : void
Based on QuestionAdministrationController::unparseAndSetAdvancedOptions() Saves the advanced question attributes as they are in the $dataSet array
saveMissingAttributes()  : Question
Adds missing question attributes with default values to the passed question

Properties

Methods

sanitizeAttributesByType()

Removes question attributes from the database that are not valid for the question's current type. This prevents orphaned attributes from a previous question type from interfering with the current type.

public sanitizeAttributesByType(Question $question) : void
Parameters
$question : Question

saveAdvanced()

Based on QuestionAdministrationController::unparseAndSetAdvancedOptions() Saves the advanced question attributes as they are in the $dataSet array

public saveAdvanced(Question $question, mixed $dataSet) : void
Parameters
$question : Question
$dataSet : mixed
Tags
throws
PersistErrorException

saveMissingAttributes()

Adds missing question attributes with default values to the passed question

public saveMissingAttributes(Question $question, int $surveyId) : Question
Parameters
$question : Question
$surveyId : int
Tags
SuppressWarnings

(PHPMD.ExcessiveMethodLength)

Return values
Question

        
On this page

Search results