class SurveyManager extends TranslatableManager implements JQGridInterface

Class SurveyManager is injected as alligator.survey_manager service. SurveyManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Properties

protected SurveyRepository $repository
protected SurveyCategoryRepository $categoryRepository
protected SurveyQuestionRepository $surveyQuestionRepository
protected SurveyQuestionAggregationRepository $aggregationRepository
protected ChoiceRepository $choiceRepository
protected SurveyCategoryEventContainer $container

Methods

setRepositoryLocale(ContainerInterface|null $container)

Sets the repository request default locale

setRepository(mixed $repository)

No description

mixed
getLanguagesForIds(array $ids)

No description

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(SurveyRepository $repository, SurveyCategoryRepository $categoryRepository, SurveyQuestionRepository $surveyQuestionRepository, SurveyQuestionAggregationRepository $aggregationRepository, ChoiceRepository $choiceRepository, SurveyCategoryEventContainer $container)

No description

array
getAllSurveyCategories()

Get all survey categories

mixed
getAllSurveyQuestions(string $locale)

Get all survey questions by locale

saveSurvey(Survey $survey)

Save survey entity to database

mixed
findSurveyCategoryBySlug(string $slug)

Find survey category by slug

array
findOneByIdForEdit(int $id, string $locale)

Find one by primary key and locale

mixed
editSurvey(Survey $survey)

Edit survey object

prepareSurveyForEditNew(Survey $survey, array $tempArray, array $tempArrayDelete)

Prepare survey for edit new

removeCurrentSurveysThatAreNotSelectedOnTheFrontEnd(Survey $oldSurvey, Survey $newSurvey)

Remove current surveys that are not selected on the front end

prepareSurveyForSave(Survey $survey)

Prepare survey object for save

prepareAggregationForSurveyEdit(Survey $oldSurvey)

Prepare aggregation for survey edit

deleteSurveys(array $arrayId)

Delete surveys by array of ids

mixed
findFeaturedSurveys(string $locale, null $slug = null)

Find featured surveys by locale and optional slug

array
getAllSurveysForSendMail(null $locale = null)

Get all surveys for send mail

array|string
getAllTreeCategoriesForCategoryAddTree(null|string $locale = null)

Get all categories for category tree

dispatchSurveyTreeGenerateSignal(string $locale)

Dispatch survey tree generate signal

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

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

Parameters

array $ids

Return Value

array

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 76
__construct(SurveyRepository $repository, SurveyCategoryRepository $categoryRepository, SurveyQuestionRepository $surveyQuestionRepository, SurveyQuestionAggregationRepository $aggregationRepository, ChoiceRepository $choiceRepository, SurveyCategoryEventContainer $container)

Parameters

SurveyRepository $repository
SurveyCategoryRepository $categoryRepository
SurveyQuestionRepository $surveyQuestionRepository
SurveyQuestionAggregationRepository $aggregationRepository
ChoiceRepository $choiceRepository
SurveyCategoryEventContainer $container

at line 90
array getAllSurveyCategories()

Get all survey categories

Return Value

array

at line 102
mixed getAllSurveyQuestions(string $locale)

Get all survey questions by locale

Parameters

string $locale

Return Value

mixed

at line 116
Survey saveSurvey(Survey $survey)

Save survey entity to database

Parameters

Survey $survey

Return Value

Survey

Exceptions

ORMException

at line 143
mixed findSurveyCategoryBySlug(string $slug)

Find survey category by slug

Parameters

string $slug

Return Value

mixed

Exceptions

NonUniqueResultException

at line 158
array findOneByIdForEdit(int $id, string $locale)

Find one by primary key and locale

Parameters

int $id
string $locale

Return Value

array

Exceptions

NonUniqueResultException

at line 172
mixed editSurvey(Survey $survey)

Edit survey object

Parameters

Survey $survey

Return Value

mixed

Exceptions

Exception

at line 213
prepareSurveyForEditNew(Survey $survey, array $tempArray, array $tempArrayDelete)

Prepare survey for edit new

Parameters

Survey $survey
array $tempArray
array $tempArrayDelete

at line 238
removeCurrentSurveysThatAreNotSelectedOnTheFrontEnd(Survey $oldSurvey, Survey $newSurvey)

Remove current surveys that are not selected on the front end

Parameters

Survey $oldSurvey
Survey $newSurvey

at line 272
prepareSurveyForSave(Survey $survey)

Prepare survey object for save

Parameters

Survey $survey

at line 290
prepareAggregationForSurveyEdit(Survey $oldSurvey)

Prepare aggregation for survey edit

Parameters

Survey $oldSurvey

at line 308
Survey deleteSurveys(array $arrayId)

Delete surveys by array of ids

Parameters

array $arrayId

Return Value

Survey

Exceptions

Exception

at line 332
mixed findFeaturedSurveys(string $locale, null $slug = null)

Find featured surveys by locale and optional slug

Parameters

string $locale
null $slug

Return Value

mixed

at line 344
array getAllSurveysForSendMail(null $locale = null)

Get all surveys for send mail

Parameters

null $locale

Return Value

array

at line 356
array|string getAllTreeCategoriesForCategoryAddTree(null|string $locale = null)

Get all categories for category tree

Parameters

null|string $locale

Return Value

array|string

at line 368
SurveySignalTreeEvent dispatchSurveyTreeGenerateSignal(string $locale)

Dispatch survey tree generate signal

Parameters

string $locale

Return Value

SurveySignalTreeEvent