class FaqQuestionRepository extends TranslatableRepository

Class FaqQuestionRepository is injected as alligator.faq_question_repository service. FaqQuestionRepository is used for crud operation for entity.

Use this class to work with database.

Traits

Trait JQGridTrait

Constants

TRANSLATION_WALKER_HINT

ALIAS

Alias for entity

FAQ_CAT_ALIAS

Alias for faq category entity

FAQ_SECOND_CAT_ALIAS

Alias for faq category entity

Properties

protected string $defaultLocale from TranslatableRepository

Methods

setDefaultLocale(string $locale)

Sets default locale

QueryBuilder
getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

mixed
getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

array
getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

QueryBuilder
getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

array
getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

QueryBuilder
getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

remove(mixed $entity)

Remove entity

bool
removeArray(array $arrayOfEntities)

Remove entities provided as array

edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

mixed
getAll()

Find all entities depending on locale

mixed
getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

QueryBuilder
getById(int $id)

Find entity by id

QueryBuilder|array
getGroupFromDB(array $array)

Find group od entities

EntityManager
getManager()

Singleton

mixed
saveCollection(array $array)

Persist collection

array
getLanguagesForIds(array $ids)

Find all distinct locale from faqs that match provided ids

Query
getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

startTransaction()

Begins transaction over database

commitTransaction()

Commit transaction over database

rollbackTransaction()

Rollback transaction over database

string
getAlias()

No description

jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

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

JQGrid function

array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Faq
saveQuestion(Faq $question)

Persist new faq entity

Faq
findOneByIdForEdit(int $id)

Find single faq for provided id

Faq
editFaqQuestion(Faq $question)

Update faq entity

Faq
editItem(Faq $item)

Update faq entity

array
getAllFaqQuestionsForDelete(array $faqQuestionsId)

Find all faqs for that match provided ids

array
findQuestionCustomByCategory(int $id, string|null $locale = null)

Find all faqs question for provided category and/or locale

array
findQuestionsForSearch(string $searchParam, FaqCategory|int $category)

Find all faqs question from specified category for provided title or answer

array
getAllFaqCategoriesSearch(string $param)

Find all faqs question for provided title or answer

array
findAllCustomForFrontendByCategories(string $param)

Find all faqs question for provided title

array
findAllCategoriesForSidebar()

Find all faqs question grouped by faq category

array
findAllForQuestionsByCategory()

Find all faqs question grouped by faq category(for default locale)

Faq
deleteFaqQuestions(array $entities)

Remove all faqs that from provided array

Details

setDefaultLocale(string $locale)

Sets default locale

Parameters

string $locale

QueryBuilder getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated one (or null if not found) result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

mixed getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)

Returns translated results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
int $hydrationMode A Doctrine results hydration mode

Return Value

mixed

array getArrayResult(QueryBuilder $qb, string $locale = null)

Returns translated array results for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 102
QueryBuilder getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)

Returns translated single result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name
string $hydrationMode A Doctrine results hydration mode

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 115
array getScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

array

in TranslatableRepository at line 130
QueryBuilder getSingleScalarResult(QueryBuilder $qb, string $locale = null)

Returns translated single scalar result for given locale

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

QueryBuilder

Exceptions

NonUniqueResultException

in TranslatableRepository at line 142
PrimaryKeyInterface save(PrimaryKeyInterface $entity)

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 172
remove(mixed $entity)

Remove entity

Parameters

mixed $entity

Exceptions

Exception

in TranslatableRepository at line 200
bool removeArray(array $arrayOfEntities)

Remove entities provided as array

Parameters

array $arrayOfEntities

Return Value

bool

Exceptions

Exception

in TranslatableRepository at line 228
PrimaryKeyInterface edit(PrimaryKeyInterface $entity)

Sets default locale to entity and merge

Parameters

PrimaryKeyInterface $entity

Return Value

PrimaryKeyInterface

Exceptions

Exception

in TranslatableRepository at line 253
mixed getAll()

Find all entities depending on locale

Return Value

mixed

in TranslatableRepository at line 270
mixed getByPrimaryKey(PrimaryKeyInterface $entity)

Find entity by primary key

Parameters

PrimaryKeyInterface $entity

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 291
QueryBuilder getById(int $id)

Find entity by id

Parameters

int $id

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

in TranslatableRepository at line 307
QueryBuilder|array getGroupFromDB(array $array)

Find group od entities

Parameters

array $array Objects

Return Value

QueryBuilder|array

in TranslatableRepository at line 332
EntityManager getManager()

Singleton

Return Value

EntityManager

in TranslatableRepository at line 352
mixed saveCollection(array $array)

Persist collection

Parameters

array $array

Return Value

mixed

Exceptions

Exception

at line 356
array getLanguagesForIds(array $ids)

Find all distinct locale from faqs that match provided ids

Parameters

array $ids

Return Value

array

in TranslatableRepository at line 396
protected Query getTranslatedQuery(QueryBuilder $qb, string $locale = null)

Returns translated Doctrine query instance

Parameters

QueryBuilder $qb A Doctrine query builder instance
string $locale A locale name

Return Value

Query

in TranslatableRepository at line 404
protected startTransaction()

Begins transaction over database

in TranslatableRepository at line 412
protected commitTransaction()

Commit transaction over database

in TranslatableRepository at line 420
protected rollbackTransaction()

Rollback transaction over database

at line 369
protected string getAlias()

Return Value

string

in JQGridTrait at line 27
jQGridJoinFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

All joins used in select.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 42
jQGridGroupByFields(QueryBuilder $qb, JQGridWrapper $jqGridWrapper)

Should contain group by which jqgrid uses.

Override in the repository class if needed. Should do nothing otherwise

Parameters

QueryBuilder $qb
JQGridWrapper $jqGridWrapper

in JQGridTrait at line 61
array findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)

JQGrid function

Parameters

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

Return Value

array

in JQGridTrait at line 94
array searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

JQGrid function

Parameters

array $searchParams
array $sortParams
bool $isCountSearch
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

array

at line 54
Faq saveQuestion(Faq $question)

Persist new faq entity

Parameters

Faq $question

Return Value

Faq

at line 76
Faq findOneByIdForEdit(int $id)

Find single faq for provided id

Parameters

int $id

Return Value

Faq

Exceptions

NoResultException
NonUniqueResultException

at line 101
Faq editFaqQuestion(Faq $question)

Update faq entity

Parameters

Faq $question

Return Value

Faq

at line 132
Faq editItem(Faq $item)

Update faq entity

Parameters

Faq $item

Return Value

Faq

at line 151
array getAllFaqQuestionsForDelete(array $faqQuestionsId)

Find all faqs for that match provided ids

Parameters

array $faqQuestionsId

Return Value

array

at line 174
array findQuestionCustomByCategory(int $id, string|null $locale = null)

Find all faqs question for provided category and/or locale

Parameters

int $id
string|null $locale

Return Value

array

at line 207
array findQuestionsForSearch(string $searchParam, FaqCategory|int $category)

Find all faqs question from specified category for provided title or answer

Parameters

string $searchParam
FaqCategory|int $category

Return Value

array

at line 235
array getAllFaqCategoriesSearch(string $param)

Find all faqs question for provided title or answer

Parameters

string $param

Return Value

array

at line 263
array findAllCustomForFrontendByCategories(string $param)

Find all faqs question for provided title

Parameters

string $param

Return Value

array

at line 289
array findAllCategoriesForSidebar()

Find all faqs question grouped by faq category

Return Value

array

at line 306
array findAllForQuestionsByCategory()

Find all faqs question grouped by faq category(for default locale)

Return Value

array

at line 334
Faq deleteFaqQuestions(array $entities)

Remove all faqs that from provided array

Parameters

array $entities

Return Value

Faq

Exceptions

ORMException