class CategoryEventContainer

Class CategoryEventContainer is injected as service. CategoryEventContainer is listener class for handling a logic for dispatched events

Constants

CATEGORY_SIDE_BAR_CASH

Category sidebar cache key

CATEGORY_MEGA_MENU

Category megamenu cache key

CATEGORY_MENU_SEARCH

Category menu search cache key

Properties

ContainerInterface $container

Methods

__construct(ContainerInterface $container)

No description

array
getExportSettings()

Get export settings

mixed
getImportCSVParentCategoriesOption()

Get import options

mixed
hasRoleAdmin()

Check if logged user has role admin

Translator
getTranslator()

Get translator service

string
getDefaultLocale()

Get default locale from current request

array
getProductsByCategoryWithPaginationSimple($id, $page, $offset, $count, $searchParams = null)

Get products bt category wth pagination options page, offset and count for category with provided id

array
doProductSearch(ProductSearchWrapper $searchWrapper)

Perform products search using ProductSearchWrapper

array
doProductSearchCount(ProductSearchWrapper $searchWrapper)

Perform count search on products using ProductSearchWrapper

mixed
getCategoryFilterPricesByCategory(int $id)

Get category filter prices for requested category

mixed
setCashCategoryTree(mixed $data, string $locale = null)

Set category tree structure to cache

mixed
setAllCategoriesToCache(mixed $data)

Set categories to cache

setFooterLayoutToCash()

Set footer html to cache

mixed
getCashCategoryTree()

Get category tree from cache

mixed
setMegaMenuCategoryTree(mixed $data, string|null $locale = null)

Set megamenu category tree to cache

mixed
getCacheMegaMenuCategoryTree()

Get megamenu category tree from cache

mixed
getAllCatsForFrontend()

Get all categories for frontend from cache

dispatchTeeGenerateSignal()

Dispatch signal for generating category tree

dispatchCategoryChangeSignal(array $categories, null $mainCategory = null, null $oldCategory = null)

Dispatch category changed signal

Event
dispatchImportCategoriesFromCSVCustom(EventWithResult $event)

Dispatch import categories from csv event

string
generateRoute(string $routeName, array $data)

Generate route for given route name and data

mixed
getFilterForCat(string $slug)

Get category filter for category by slug

Event
dispatchPromoProductsReCache()

Dispatch event to update cached products

dispatchCategoryDisplayChange(Category $category)

Dispatch category display change signal

dispatchProductGroupsUpdateEvent(ProductGroupEvent $productGroupEvent)

Dispatch product groups update event

dispatchCategoryTreeDecoratorEvent(string $locale)

Dispatch tree decorator event for given locale

dispatchCategoryTreeConditionsEvent()

Dispatch category tree contidions event

mixed
dispatchCategoryEvent(ProductSearchWrapper $searchWrapper)

Dispatch category event

deleteImagesFromCatGallery(mixed $images)

Delete images from category gallery

removeImageFromDb(Image $image)

Remove image from database

mixed
getCategorySlug()

Get category slug

array
getAvailableLanguages()

Get available languages

dispatchGenerateTranslationSignal(mixed $responseArray)

Dispatch generate translations signal with response array as argument

dispatchDeleteBrandTranslations(mixed $keys)

Dispatch delete brand translations with keys argument

dispatchRemoveImagesForDeletedCategories(array $imagesIds)

Dispatch remove images for deleted categories with images id as arguments

signalCategoryProductCountUpdate()

Dispatch signal for category product count update

setNewRequest(Request $request)

Adds new request to request stack

bool|mixed|SearchSettings|string
getSearchSettings()

Get search settings from cache

string
transCategory(string $key, string $locale)

Translate category by key and locale

mixed
getCurrentUser()

Get current logged user from token storage

dispatchRegexCreateEvent(string $regex)

Dispatch regex create event

boolean
checkIfPermalinkIsAvailable(string $permalink)

Check if permalink is available

Details

at line 58
__construct(ContainerInterface $container)

Parameters

ContainerInterface $container

at line 67
array getExportSettings()

Get export settings

Return Value

array

at line 78
mixed getImportCSVParentCategoriesOption()

Get import options

Return Value

mixed

at line 87
mixed hasRoleAdmin()

Check if logged user has role admin

Return Value

mixed

at line 96
Translator getTranslator()

Get translator service

Return Value

Translator

at line 105
string getDefaultLocale()

Get default locale from current request

Return Value

string

at line 121
array getProductsByCategoryWithPaginationSimple($id, $page, $offset, $count, $searchParams = null)

Get products bt category wth pagination options page, offset and count for category with provided id

Parameters

$id
$page
$offset
$count
$searchParams

Return Value

array

Exceptions

DBALException

at line 134
array doProductSearch(ProductSearchWrapper $searchWrapper)

Perform products search using ProductSearchWrapper

Parameters

ProductSearchWrapper $searchWrapper

Return Value

array

See also

ProductSearchWrapper

at line 147
array doProductSearchCount(ProductSearchWrapper $searchWrapper)

Perform count search on products using ProductSearchWrapper

Parameters

ProductSearchWrapper $searchWrapper

Return Value

array

See also

ProductSearchWrapper

at line 158
mixed getCategoryFilterPricesByCategory(int $id)

Get category filter prices for requested category

Parameters

int $id

Return Value

mixed

at line 170
mixed setCashCategoryTree(mixed $data, string $locale = null)

Set category tree structure to cache

Parameters

mixed $data
string $locale null $locale

Return Value

mixed

at line 183
mixed setAllCategoriesToCache(mixed $data)

Set categories to cache

Parameters

mixed $data

Return Value

mixed

at line 193
setFooterLayoutToCash()

Set footer html to cache

at line 203
mixed getCashCategoryTree()

Get category tree from cache

Return Value

mixed

at line 217
mixed setMegaMenuCategoryTree(mixed $data, string|null $locale = null)

Set megamenu category tree to cache

Parameters

mixed $data
string|null $locale

Return Value

mixed

at line 228
mixed getCacheMegaMenuCategoryTree()

Get megamenu category tree from cache

Return Value

mixed

at line 238
mixed getAllCatsForFrontend()

Get all categories for frontend from cache

Return Value

mixed

at line 248
CategoryTreeSignalEvent dispatchTeeGenerateSignal()

Dispatch signal for generating category tree

at line 262
dispatchCategoryChangeSignal(array $categories, null $mainCategory = null, null $oldCategory = null)

Dispatch category changed signal

Parameters

array $categories
null $mainCategory
null $oldCategory

at line 281
Event dispatchImportCategoriesFromCSVCustom(EventWithResult $event)

Dispatch import categories from csv event

Parameters

EventWithResult $event

Return Value

Event

at line 293
string generateRoute(string $routeName, array $data)

Generate route for given route name and data

Parameters

string $routeName
array $data

Return Value

string

at line 304
mixed getFilterForCat(string $slug)

Get category filter for category by slug

Parameters

string $slug

Return Value

mixed

at line 313
Event dispatchPromoProductsReCache()

Dispatch event to update cached products

Return Value

Event

at line 324
CategoryEvent dispatchCategoryDisplayChange(Category $category)

Dispatch category display change signal

Parameters

Category $category

Return Value

CategoryEvent

at line 340
EventWithResult|Event dispatchProductGroupsUpdateEvent(ProductGroupEvent $productGroupEvent)

Dispatch product groups update event

Parameters

ProductGroupEvent $productGroupEvent

Return Value

EventWithResult|Event

at line 352
CategoryEvent dispatchCategoryTreeDecoratorEvent(string $locale)

Dispatch tree decorator event for given locale

Parameters

string $locale

Return Value

CategoryEvent

at line 364
EventWithResult|Event dispatchCategoryTreeConditionsEvent()

Dispatch category tree contidions event

Return Value

EventWithResult|Event

at line 375
mixed dispatchCategoryEvent(ProductSearchWrapper $searchWrapper)

Dispatch category event

Parameters

ProductSearchWrapper $searchWrapper

Return Value

mixed

at line 387
deleteImagesFromCatGallery(mixed $images)

Delete images from category gallery

Parameters

mixed $images

at line 399
removeImageFromDb(Image $image)

Remove image from database

Parameters

Image $image

Exceptions

ORMException
OptimisticLockException

at line 411
mixed getCategorySlug()

Get category slug

Return Value

mixed

at line 425
array getAvailableLanguages()

Get available languages

Return Value

array

at line 434
dispatchGenerateTranslationSignal(mixed $responseArray)

Dispatch generate translations signal with response array as argument

Parameters

mixed $responseArray

at line 446
dispatchDeleteBrandTranslations(mixed $keys)

Dispatch delete brand translations with keys argument

Parameters

mixed $keys

at line 455
dispatchRemoveImagesForDeletedCategories(array $imagesIds)

Dispatch remove images for deleted categories with images id as arguments

Parameters

array $imagesIds

at line 464
CategoryEvent signalCategoryProductCountUpdate()

Dispatch signal for category product count update

Return Value

CategoryEvent

at line 475
setNewRequest(Request $request)

Adds new request to request stack

Parameters

Request $request

at line 486
bool|mixed|SearchSettings|string getSearchSettings()

Get search settings from cache

Return Value

bool|mixed|SearchSettings|string

at line 498
string transCategory(string $key, string $locale)

Translate category by key and locale

Parameters

string $key
string $locale

Return Value

string

at line 507
mixed getCurrentUser()

Get current logged user from token storage

Return Value

mixed

at line 518
EventWithResult dispatchRegexCreateEvent(string $regex)

Dispatch regex create event

Parameters

string $regex

Return Value

EventWithResult

at line 529
boolean checkIfPermalinkIsAvailable(string $permalink)

Check if permalink is available

Parameters

string $permalink

Return Value

boolean