InitializationTrait
Table of Contents
Properties
- $categoryTree : array<int, array<string, mixed>>|null
- Tree from {@see TreeStructure::prepareForTemplate()}; never mutated, assigned to the template by value.
- $loadedCategories : array<int, object>|null
- Categories loaded once per component instance (the query does not depend on render arguments).
- $rootCategoryTree : array<int, array{item: object, children: array, hasChildren: bool}>|null
- Only root categories as tree nodes (see the `$rootsOnly` branch in `intilializeRender()`).
Methods
- getActivePath() : array<int, int>
- getCurrentCategory() : Category|null
- intilializeRender() : void
Properties
$categoryTree
Tree from {@see TreeStructure::prepareForTemplate()}; never mutated, assigned to the template by value.
private
array<int, array<string, mixed>>|null
$categoryTree
= null
$loadedCategories
Categories loaded once per component instance (the query does not depend on render arguments).
private
array<int, object>|null
$loadedCategories
= null
$rootCategoryTree
Only root categories as tree nodes (see the `$rootsOnly` branch in `intilializeRender()`).
private
array<int, array{item: object, children: array, hasChildren: bool}>|null
$rootCategoryTree
= null
Methods
getActivePath()
private
getActivePath(array<string|int, object> $categories, Category|null $currentCategory) : array<int, int>
Parameters
- $categories : array<string|int, object>
- $currentCategory : Category|null
Return values
array<int, int>getCurrentCategory()
private
getCurrentCategory() : Category|null
Return values
Category|nullintilializeRender()
private
intilializeRender([array<string|int, mixed> $items = [] ][, bool $rootsOnly = false ]) : void
Parameters
- $items : array<string|int, mixed> = []
- $rootsOnly : bool = false