StaticPageCategoryRepository
class StaticPageCategoryRepository extends CategoryTranslatableRepository implements AbstractBlockElementRepositoryInterface
Class StaticPageCategoryRepository is injected as alligator.static_page_category_repository service. StaticPageCategoryRepository is used for crud operation for entity.
Use this class to work with database.
Traits
Constants
| TRANSLATION_WALKER_HINT |
|
| ALIAS |
Alias for main entity |
| POSTS_ALIAS |
Alias |
| STATIC_CATEGORY_BLOCKS_RESULT_CACHE |
Key for caching static page category blocks |
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
Get alias for main entity
Should contain group by which jqgrid uses.
JQGrid function
JQGrid function
Get array of slugs for all static page categories
Update number of visible static pages
Update number of visible static pages for elements in array
Find Static Page Category by slug
Get tree for Static Page Category
Get all static pages by array of ids for delete
Delete Static page categories
UnfinishedMethod. You can adjust these method if you want layers with categories in megamenu.
Get distinct languages for specified 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)
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 55
string
getAlias()
Get alias for main entity
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
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
in JQGridTrait at line 61
array
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams, JQGridWrapper $jqGridWrapper)
JQGrid function
in JQGridTrait at line 94
array
searchForJQGRID(array $searchParams, array $sortParams, bool $isCountSearch = false, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)
JQGrid function
in EmpireNestedTreeRepositoryTrait at line 23
array
hasRootCategory()
Find root node
at line 66
object
saveStaticPageCategory(StaticPageCategory $staticPageCategory)
Persist new Static Page Category
at line 99
array
getAllCategoriesSlugs()
Get array of slugs for all static page categories
at line 112
object
editFields(StaticPageCategory $staticPageCategory)
Merge Static Page Category
at line 156
persistRoot(StaticPageCategory $category)
Persist static page category root
at line 167
object
changePosition(StaticPageCategory $category, mixed $oldParent)
at line 208
updateNumberOfPostsForVisibleItems(StaticPageCategory $entity)
Update number of visible static pages
at line 234
updateNumberOfPostsForArrayForVisibleItems(array $array)
Update number of visible static pages for elements in array
at line 268
StaticPageCategory
findCategoryBySlug(string $slug, string|null $locale = null)
Find Static Page Category by slug
at line 291
array|string
getCategoryTree(mixed $options, null $locale = null, boolean $frontend = false)
Get tree for Static Page Category
at line 323
array
getAllStaticPageCategoriesForDelete(array $ids)
Get all static pages by array of ids for delete
at line 338
bool
deleteStaticPageCategories(array $blogCategories)
Delete Static page categories
at line 368
array|string
getTreeForMegamenuFromDB()
UnfinishedMethod. You can adjust these method if you want layers with categories in megamenu.
at line 427
array
getLanguagesForIds(array $ids)
Get distinct languages for specified ids
at line 439
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 458
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 472
deleteResultCaches()
Delete all cached results