AlligatorCategoryExtension
class AlligatorCategoryExtension extends Twig_Extension
Class AlligatorCategoryExtension is injected as twig.extension.alligator.category service. AlligatorCategoryExtension handles the logic and provides necessary data for managed entity in twig.
Properties
| protected CategoryManager | $categoryManager |
Methods
{@inheritdoc}
Get featured categories limit with max argument
Returns the name of the extension.
Get root categories
Get tree categories from cache or cache them
Get megamenu category tree from cache
Get category from request slug
Get categories for backend
Set tree categories to cache
Set megamenu categories to cache
Set footer layout to cache
Get all categories fro frontend
Set all categories to cache
Set new request
Get parent category slug
Update has visible categories on parent change
No description
Get all subcategories for category and locale
Details
at line 67
__construct(CategoryManager $categoryManager)
Constructor
at line 75
getFunctions()
{@inheritdoc}
at line 96
mixed
getFeaturedCats(int $max = 6)
Get featured categories limit with max argument
at line 106
string
getName()
Returns the name of the extension.
at line 117
QueryBuilder|null
getRootCategories(null $limit = null)
Get root categories
at line 132
QueryBuilder|null
getTreeCategories(bool $useFromCache = true)
Get tree categories from cache or cache them
at line 149
QueryBuilder|null
geMegaMenuCategories()
Get megamenu category tree from cache
at line 164
string
getCategoryFromRequestSlug()
Get category from request slug
at line 176
array|string
geCategoriesForBackend(bool|false $displayNonVisible = false, bool|true $useCache = true)
Get categories for backend
at line 207
setTreeCategoriesToCache(null $locale = null, bool $useFromCache = true, string|null $slug = null)
Set tree categories to cache
at line 307
setMegaMenuCategoriesToCache(string $locale = null)
Set megamenu categories to cache
at line 378
setFooterLayoutToCash()
Set footer layout to cache
at line 387
array
getAllCategories()
Get all categories fro frontend
at line 402
mixed
setAllCategoriesToCache()
Set all categories to cache
at line 411
setNewRequest(Request $request)
Set new request
at line 424
mixed|null
getParentCategorySlug(string $slug)
Get parent category slug
at line 442
bool
handleHasActiveCategories(null $category = null, null $oldParent = null)
Update has visible categories on parent change
at line 450
CategoryManager
getCategoryManager()
at line 464
array|string
getAllSubcategories(Category $category, string $locale, bool|false $displayNonVisible = false, array $visibleCategories = null)
Get all subcategories for category and locale