AnswerManager
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
from TranslatableManager
__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
Details
in TranslatableManager at line 30
setRepositoryLocale(ContainerInterface|null $container)
Sets the repository request default locale
in TranslatableManager at line 63
setRepository(mixed $repository)
in TranslatableManager at line 73
mixed
getLanguagesForIds(array $ids)
at line 65
__construct(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
at line 94
array
prepareAnswersForStatistics(int $id)
Method returns array of Std objects with properties question and choices
at line 129
mixed
populateCharts(array $objectsArray)
Populate charts
at line 208
array
createStatistics(int $id)
Create statistic for survey by primary key
at line 222
Answer
saveItem(array $answers)
Persist entities to database