FaqCategoryRepository
class FaqCategoryRepository extends CategoryTranslatableRepository implements AbstractBlockElementRepositoryInterface
Class FaqCategoryRepository is injected as alligator.faq_category_repository service. FaqCategoryRepository is used for crud operation for entity.
Use this class to work with database.
Traits
Constants
| TRANSLATION_WALKER_HINT |
|
| ALIAS |
Alias for entity |
| FAQ_CATEGORY_BLOCKS_RESULT_CACHE |
Cache key |
Properties
| protected string | $defaultLocale | from CategoryTranslatableRepository |
Methods
Returns translated one (or null if not found) result for given locale
Returns translated results for given locale
Returns translated array results for given locale
Returns translated single result for given locale
Returns translated scalar result for given locale
Returns translated single scalar result for given locale
Find all entities ordered by id descending
Find entities for provided array of entities
Persist array of new entities
Returns translated Doctrine query instance
No description
Find all faq categories
Find slug of all faq categories
Find single faq category for provided id
Find all faq categories that match provided ids
No description
Update all child elements
Find all faq category id and name
Retrieves the nested array or the decorated output.
Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)
Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field
delete all cached results
Details
in CategoryTranslatableRepository at line 41
setDefaultLocale(string $locale)
Sets default locale
in CategoryTranslatableRepository at line 57
QueryBuilder
getOneOrNullResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)
Returns translated one (or null if not found) result for given locale
in CategoryTranslatableRepository at line 71
QueryBuilder
getResult(QueryBuilder $qb, string $locale = null, int $hydrationMode = AbstractQuery::HYDRATE_OBJECT)
Returns translated results for given locale
in CategoryTranslatableRepository at line 84
mixed
getArrayResult(QueryBuilder $qb, string $locale = null)
Returns translated array results for given locale
in CategoryTranslatableRepository at line 101
QueryBuilder
getSingleResult(QueryBuilder $qb, string $locale = null, string $hydrationMode = null)
Returns translated single result for given locale
in CategoryTranslatableRepository at line 114
array
getScalarResult(QueryBuilder $qb, string $locale = null)
Returns translated scalar result for given locale
in CategoryTranslatableRepository at line 129
QueryBuilder
getSingleScalarResult(QueryBuilder $qb, string $locale = null)
Returns translated single scalar result for given locale
in CategoryTranslatableRepository at line 142
PrimaryKeyInterface
save(PrimaryKeyInterface $entity)
Persist new entity to database
in CategoryTranslatableRepository at line 171
remove(mixed $entity)
Remove entity from database
in CategoryTranslatableRepository at line 197
PrimaryKeyInterface
edit(PrimaryKeyInterface $entity)
Merge entity
in CategoryTranslatableRepository at line 220
QueryBuilder
getAll()
Find all entities ordered by id descending
in CategoryTranslatableRepository at line 237
QueryBuilder
getByPrimaryKey(PrimaryKeyInterface $entity, mixed $param = null)
Find entity by primary key
in CategoryTranslatableRepository at line 255
mixed
getById(int $id)
Find entity by id
in CategoryTranslatableRepository at line 270
QueryBuilder|array
getGroupFromDB(mixed $array)
Find entities for provided array of entities
in CategoryTranslatableRepository at line 295
EntityManager
getManager()
Singleton
in CategoryTranslatableRepository at line 314
mixed
saveCollection(array $array)
Persist array of new entities
in CategoryTranslatableRepository at line 341
protected Query
getTranslatedQuery(QueryBuilder $qb, string $locale = null)
Returns translated Doctrine query instance
in CategoryTranslatableRepository at line 349
protected
startTransaction()
Begins transaction over database
in CategoryTranslatableRepository at line 357
protected
commitTransaction()
Commit transaction over database
in CategoryTranslatableRepository at line 365
protected
rollbackTransaction()
Rollback transaction over database
at line 457
protected string
getAlias()
in EmpireNestedTreeRepositoryTrait at line 23
array
hasRootCategory()
Find root node
at line 46
array
getAllFaqCategories()
Find all faq categories
at line 63
array
getAllFaqCategoriesSlugs()
Find slug of all faq categories
at line 78
stdClass
saveFaqCategory(FaqCategory $category)
Persist new faq category
at line 120
array
findOneByIdForEdit(int $id)
Find single faq category for provided id
at line 147
FaqCategory
editFaqCategory(FaqCategory $faqCategory)
Update existing faq category
at line 166
array
getAllFaqCategoriesForDelete(array $faqCategoriesId)
Find all faq categories that match provided ids
at line 186
int
deleteFaqCategories(array $items)
at line 216
stdClass
editFields(FaqCategory $faqCategory)
Update existing faq category
at line 253
persistRoot(FaqCategory $category)
Persist root faq category
at line 266
stdClass
changePosition(FaqCategory $category, mixed $oldParent)
Change position of node
at line 307
updateNumberOfItems(FaqCategory $entity)
Update all child elements
at line 333
updateNumberOfItemsForArray(array $array)
Update all child elements
at line 359
array
findCategoriesForCatAdd()
Find all faq category id and name
at line 376
array|string
getCategoryTree(array $options, string|null $locale = null, bool $frontend = false)
Retrieves the nested array or the decorated output.
at line 403
array
getEntitiesForBlockElementsExtension(array $ids)
Get entities from database by ids Tis method is used to for block elements extension Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field Also make sure you cache this data -> qb->useQueryCache(true)->useResultCache(true, 3600)
at line 431
array
getEntityNamesForIds(array $ids)
Get id and name (field must be name so change it in select) of entity Used in event for block element edit Make sure you order data by ids - ids is array of elements and it is sorted by priority - so add this to select -> ' FIELD('.$this->getAlias().'.id'.', '.implode(', ', $ids).') AS sort_col'); - and order by this field
at line 449
deleteResultCaches()
delete all cached results