class AnswerManager extends TranslatableManager

Class AnswerManager is injected as alligator.answer_manager service. AnswerManager handles the logic for managed entity.

Properties

protected AnswerRepository $repository
protected SurveyQuestionRepository $surveyQuestionRepository
protected SurveyRepository $surveyRepository
protected ChoiceRepository $choiceRepository
protected UserRepository $userRepository
protected SurveyUserManager $surveyUserManager

Methods

setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

setRepository(mixed $repository)

No description

mixed
getLanguagesForIds(array $ids)

No description

__construct(AnswerRepository $repository, SurveyRepository $surveyRepository, SurveyQuestionRepository $surveyQuestionRepository, ChoiceRepository $choiceRepository, UserRepository $userRepository, SurveyUserManager $surveyUserManager)

No description

array
getAnswersBySurvey(int $id)

Get answers by survey primary key

array
prepareAnswersForStatistics(int $id)

Method returns array of Std objects with properties question and choices

mixed
populateCharts(array $objectsArray)

Populate charts

array
createStatistics(int $id)

Create statistic for survey by primary key

saveItem(array $answers)

Persist entities to database

Details

in TranslatableManager at line 30
setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

Parameters

ContainerInterface|null $container

Exceptions

InvalidArgumentException if repository is not an instance of TranslatableRepository

in TranslatableManager at line 63
setRepository(mixed $repository)

Parameters

mixed $repository

in TranslatableManager at line 73
mixed getLanguagesForIds(array $ids)

Parameters

array $ids

Return Value

mixed

at line 65
__construct(AnswerRepository $repository, SurveyRepository $surveyRepository, SurveyQuestionRepository $surveyQuestionRepository, ChoiceRepository $choiceRepository, UserRepository $userRepository, SurveyUserManager $surveyUserManager)

Parameters

AnswerRepository $repository
SurveyRepository $surveyRepository
SurveyQuestionRepository $surveyQuestionRepository
ChoiceRepository $choiceRepository
UserRepository $userRepository
SurveyUserManager $surveyUserManager

at line 82
array getAnswersBySurvey(int $id)

Get answers by survey primary key

Parameters

int $id

Return Value

array

at line 94
array prepareAnswersForStatistics(int $id)

Method returns array of Std objects with properties question and choices

Parameters

int $id

Return Value

array

at line 129
mixed populateCharts(array $objectsArray)

Populate charts

Parameters

array $objectsArray

Return Value

mixed

at line 208
array createStatistics(int $id)

Create statistic for survey by primary key

Parameters

int $id

Return Value

array

at line 222
Answer saveItem(array $answers)

Persist entities to database

Parameters

array $answers

Return Value

Answer