TransformerOutputSurveyDetail
extends TransformerOutputActiveRecord
in package
TransformerOutputSurveyDetail
Table of Contents
Properties
- $registry : Registry|null
- $dataMap : array<string|int, mixed>
- $defaultConfig : array<string|int, mixed>
- $questionService : QuestionService
- $transformerAnswer : TransformerOutputAnswer
- $transformerAnswerL10ns : TransformerOutputAnswerL10ns
- $transformerQuestion : TransformerOutputQuestion
- $transformerQuestionAttribute : TransformerOutputQuestionAttribute
- $transformerQuestionGroup : TransformerOutputQuestionGroup
- $transformerQuestionGroupL10ns : TransformerOutputQuestionGroupL10ns
- $transformerQuestionL10ns : TransformerOutputQuestionL10ns
- $transformerSurvey : TransformerOutputSurvey
- $transformerSurveyGroup : TransformerOutputSurveyGroup
- $transformerSurveyOwner : TransformerOutputSurveyOwner
Methods
- __construct() : mixed
- Construct
- getDataMap() : array<string|int, mixed>
- Get data map
- setDataMap() : void
- Set data map
- setDefaultConfig() : void
- Set default config
- setRegistry() : void
- Called automatically by DI container via @Inject annotation Whenever we are on PHP 8.1 we can switch this to PHP attributes
- transform() : mixed|null
- Transform
- transformAll() : array<string|int, mixed>
- Transform collection
- validate() : bool|array<string|int, mixed>
- validateAll() : bool|array<string|int, mixed>
- Validate collection
- cast() : mixed
- Cast Value
- createCollectionLookup() : array<string|int, mixed>
- Create collection lookup
- filter() : mixed
- Filter Value
- format() : mixed
- Format Value Looks for possible formatter in the config, tries to get it from the registry and calls the format method on it.
- getDefaultConfig() : array<string|int, mixed>
- Get default config
- normaliseConfig() : array<string|int, mixed>
- Normalise config
- setInheritedBetaOptions() : Survey
- Some survey settings are inherited from the survey group, so we need to replace the inherited info ("I") with the real values.
- transformAnswersL10n() : void
- Adds the language specific data of answer_l10ns to the answers array
- transformQuestions() : void
- Transform Questions
- validateKey() : bool|array<string|int, mixed>
- Validate Value
Properties
$registry
public
Registry|null
$registry
$dataMap
protected
array<string|int, mixed>
$dataMap
= []
$defaultConfig
protected
array<string|int, mixed>
$defaultConfig
= []
$questionService
private
QuestionService
$questionService
$transformerAnswer
private
TransformerOutputAnswer
$transformerAnswer
$transformerAnswerL10ns
private
TransformerOutputAnswerL10ns
$transformerAnswerL10ns
$transformerQuestion
private
TransformerOutputQuestion
$transformerQuestion
$transformerQuestionAttribute
private
TransformerOutputQuestionAttribute
$transformerQuestionAttribute
$transformerQuestionGroup
private
TransformerOutputQuestionGroup
$transformerQuestionGroup
$transformerQuestionGroupL10ns
private
TransformerOutputQuestionGroupL10ns
$transformerQuestionGroupL10ns
$transformerQuestionL10ns
private
TransformerOutputQuestionL10ns
$transformerQuestionL10ns
$transformerSurvey
private
TransformerOutputSurvey
$transformerSurvey
$transformerSurveyGroup
private
TransformerOutputSurveyGroup
$transformerSurveyGroup
$transformerSurveyOwner
private
TransformerOutputSurveyOwner
$transformerSurveyOwner
Methods
__construct()
Construct
public
__construct(TransformerOutputSurvey $transformerOutputSurvey, TransformerOutputSurveyGroup $transformerOutputSurveyGroup, TransformerOutputQuestionGroup $transformerOutputQuestionGroup, TransformerOutputQuestionGroupL10ns $transformerOutputQuestionGroupL10ns, TransformerOutputQuestion $transformerOutputQuestion, TransformerOutputQuestionL10ns $transformerOutputQuestionL10ns, TransformerOutputQuestionAttribute $transformerOutputQuestionAttribute, TransformerOutputAnswer $transformerOutputAnswer, TransformerOutputAnswerL10ns $transformerOutputAnswerL10ns, TransformerOutputSurveyOwner $transformerOutputSurveyOwner, QuestionService $questionService) : mixed
Parameters
- $transformerOutputSurvey : TransformerOutputSurvey
- $transformerOutputSurveyGroup : TransformerOutputSurveyGroup
- $transformerOutputQuestionGroup : TransformerOutputQuestionGroup
- $transformerOutputQuestionGroupL10ns : TransformerOutputQuestionGroupL10ns
- $transformerOutputQuestion : TransformerOutputQuestion
- $transformerOutputQuestionL10ns : TransformerOutputQuestionL10ns
- $transformerOutputQuestionAttribute : TransformerOutputQuestionAttribute
- $transformerOutputAnswer : TransformerOutputAnswer
- $transformerOutputAnswerL10ns : TransformerOutputAnswerL10ns
- $transformerOutputSurveyOwner : TransformerOutputSurveyOwner
- $questionService : QuestionService
getDataMap()
Get data map
public
getDataMap() : array<string|int, mixed>
Return values
array<string|int, mixed>setDataMap()
Set data map
public
setDataMap(array<string|int, mixed> $dataMap) : void
Data map is an associative array. Key is the key in the source data and value is either boolean true
- to include the data as is or a a string field name to map the value
- to in the output.
Parameters
- $dataMap : array<string|int, mixed>
setDefaultConfig()
Set default config
public
setDefaultConfig(array<string|int, mixed> $defaultConfig) : void
Parameters
- $defaultConfig : array<string|int, mixed>
setRegistry()
Called automatically by DI container via @Inject annotation Whenever we are on PHP 8.1 we can switch this to PHP attributes
public
setRegistry(Registry $registry) : void
Parameters
- $registry : Registry
Tags
transform()
Transform
public
transform(mixed|null $data[, mixed|null $options = [] ]) : mixed|null
Returns an array of entity references indexed by the specified key.
Parameters
- $data : mixed|null
- $options : mixed|null = []
Tags
Return values
mixed|nulltransformAll()
Transform collection
public
transformAll(array<string|int, mixed> $collection[, array<string|int, mixed>|null $options = [] ]) : array<string|int, mixed>
Parameters
- $collection : array<string|int, mixed>
- $options : array<string|int, mixed>|null = []
Return values
array<string|int, mixed>validate()
public
validate(mixed $data[, array<string|int, mixed>|null $options = [] ]) : bool|array<string|int, mixed>
Parameters
- $data : mixed
- $options : array<string|int, mixed>|null = []
Return values
bool|array<string|int, mixed> —Returns true on success or array of errors.
validateAll()
Validate collection
public
validateAll(array<string|int, mixed> $collection[, array<string|int, mixed>|null $options = [] ]) : bool|array<string|int, mixed>
Parameters
- $collection : array<string|int, mixed>
- $options : array<string|int, mixed>|null = []
Return values
bool|array<string|int, mixed> —Returns true on success or array of errors.
cast()
Cast Value
private
cast(mixed $value, array<string|int, mixed> $config) : mixed
Parameters
- $value : mixed
- $config : array<string|int, mixed>
createCollectionLookup()
Create collection lookup
private
createCollectionLookup(string $key, array<string|int, mixed> &$entityArray) : array<string|int, mixed>
Returns an array of entity references indexed by the specified key.
Parameters
- $key : string
- $entityArray : array<string|int, mixed>
Return values
array<string|int, mixed> —Entity reference
filter()
Filter Value
private
filter(mixed $value, array<string|int, mixed> $config) : mixed
Parameters
- $value : mixed
- $config : array<string|int, mixed>
format()
Format Value Looks for possible formatter in the config, tries to get it from the registry and calls the format method on it.
private
format(mixed $value, array<string|int, mixed> $config) : mixed
Parameters
- $value : mixed
- $config : array<string|int, mixed>
getDefaultConfig()
Get default config
private
getDefaultConfig() : array<string|int, mixed>
Return values
array<string|int, mixed>normaliseConfig()
Normalise config
private
normaliseConfig(bool|int|string|array<string|int, mixed> $config, string|int $inputKey[, array<string|int, mixed> $options = [] ]) : array<string|int, mixed>
Parameters
- $config : bool|int|string|array<string|int, mixed>
- $inputKey : string|int
- $options : array<string|int, mixed> = []
Return values
array<string|int, mixed>setInheritedBetaOptions()
Some survey settings are inherited from the survey group, so we need to replace the inherited info ("I") with the real values.
private
setInheritedBetaOptions(Survey $survey) : Survey
This is a temporary solution until we display the inherit option in the new UI.
Parameters
- $survey : Survey
Return values
Survey —$survey
transformAnswersL10n()
Adds the language specific data of answer_l10ns to the answers array
private
transformAnswersL10n(array<string|int, mixed> $answerLookup, array<string|int, mixed> $answers[, array<string|int, mixed>|null $options = [] ]) : void
Parameters
- $answerLookup : array<string|int, mixed>
- $answers : array<string|int, mixed>
- $options : array<string|int, mixed>|null = []
transformQuestions()
Transform Questions
private
transformQuestions(array<string|int, mixed> $questionLookup, array<string|int, mixed> $questions[, array<string|int, mixed>|null $options = [] ]) : void
Returns an array of entity references indexed by the specified key.
Parameters
- $questionLookup : array<string|int, mixed>
- $questions : array<string|int, mixed>
- $options : array<string|int, mixed>|null = []
validateKey()
Validate Value
private
validateKey(string $key, mixed $value, array<string|int, mixed> $config, array<string|int, mixed> $data[, array<string|int, mixed>|null $options = [] ]) : bool|array<string|int, mixed>
Returns boolean true or array of errors.
Parameters
- $key : string
- $value : mixed
- $config : array<string|int, mixed>
- $data : array<string|int, mixed>
- $options : array<string|int, mixed>|null = []