class CategoryManager implements BasicEntityManagerInterface, CategoryManagerInterface, CSVManagerInterface, JQGridInterface

Class CategoryManager is injected as alligator.category_manager service. CategoryManager handles the logic for managed entity.

Traits

Trait JQGridManagerTrait
Class BlockElementManagerTrait. Handles reading data for block elements

Properties

protected CategoryRepository $repository
protected CategoryEventContainer $eventContainer
protected array $leafsArray

Methods

mixed
searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

No description

mixed
getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

No description

array
getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

array
getEntityNamesForIds(array $ids)

Get id and name of entity

__construct(CategoryRepository $repository, CategoryEventContainer $eventContainer)

No description

string
transCategory(string $key, string $locale)

Translate category for key and locale

array
getAllCategoriesNew()

Get all categories

QueryBuilder
findAllCategories()

Returns all objects without additional JOIN query

mixed
findAllParentCategories(int $id, int $lft, int $rgt)

Find all parent categories

array
findAllCategoriesWithContainingBrands()

Find all categories with containing brands

mixed
findAllCategoriesIds()

Find all categories ids

array
getAllCategoriesIdAndName()

Get all categories id and name

array
getAllCategoriesIdNameAndDescription()

Get all categories id, name and description

array
findAllCategoriesForProductAdd()

Find all categories for product add

getDBCategory(Category $category)

Get Category from database

mixed
getDBCategoryByName(String $categoryName)

Get database category by name

mixed
getDBCategoryByCode(String $categoryCode)

Get database category by code

mixed
getParentCategorySlug(String $slug)

Get parent category by slug

mixed
getDBCategoryIDBySlug(Category $category)

Get category id by slug

mixed
getDBCategoryFilterDataSlug(Category $category)

Get database category filter by slug

getDBCategoryForCategoryPage(Category $category)

Get category for category page

deleteCategory(mixed $array)

Delete categories from array

ArrayCollection
getCategoriesGroup(mixed $array)

Get database categories from array

array
getFeaturedCats(int $max = 6)

Get featured categories

array
getAggregatorCategories()

Get first level categories for category aggregator page

array
getAllCats(null $rootCats = null)

Get all categories

mixed|void
exportToCSV()

Export to CSV

mixed|void
exportCustom(array $data)

Custom export to CSV

getEntityObject()

Get new Category object

mixed
importFromCSV(mixed $base64Content, mixed $locale, array $propertyMappings = array(), mixed $importHasParentFiled = false)

Import from CSV with base64 content of a file

mixed
saveObjectsFromCSV(ArrayCollection $objectList, array $csvRow, array $entityCSVHeaders, array $propertyMappings = array())

Persist entities to database

array
convertFromCSVRowsToTreeWithParentName(array $objectList)

Convert from CSV rows to tree

generateIdsForCategoryTreeWithParentName(mixed $parent, array $treeCats)

Generate ids for category tree

array
convertFromCSVRowsToTree(array $objectList)

Convert from CSV rows to tree

generateIdsForCategoryTree(mixed $parent, array $treeCats)

Generate ids for category tree

QueryBuilder
getRootCategories(null $limit = null)

Get root categories

QueryBuilder
getRootFromDb()

Get root category from database

QueryBuilder
getRootObjFromDb()

Get root object from database

mixed
hasRoleAdmin()

Check if logged user has role admin

string
getCurrentLocale()

Get current locale from request

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

Get products for category with pagination

array
sortProductsInCategory(int $categoryId, int $productId, int $newIndex, bool $hasPriority)

Sort products inside category

mixed
getCategoryFilterPricesByCategory(int $id)

Get category filter prices by category

mixed
saveTreeCategoryForAdd(Category $category, bool $isCmdAdd = false)

Save tree category for add can be used from cmd

array|string
getCatsAsTreeForBackend()

Get category tree for backend

mixed
editCatTree(Category $newCategory, mixed $positionChanged, Category $previous, mixed $removedGalleryImages)

Edit category tree

removeImageFromDb(Image $image)

Remove image from database

setExternalLinksImages(Category $category)

Set external category link images

int
deleteTreeCategories(array $ids)

Delete category from tree structure

array|string
getAllTreeCategories(array $options, bool|false $displayNonVisible = false)

Get all categories for tree

array|string
getAllTreeCategoriesForCategoryAddTree()

Get all tree categories for add category page

array|null|string
getAllTreeCategoriesWithPagination(int|string $id, bool $withRoot, array $options, array $additionalCategories)

No description

array
getLftRgtData($cat)

No description

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

Set category tree to cache

mixed
getCashCategoryTree()

Get category tree from cache

mixed
getMegaMenuCashCategoryTree()

Get megamenu tree form cache

mixed
getAllCatsForFrontend()

Get all categories for frontend

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

Set megamenu categories tree to cache

dispatchTeeGenerateSignal()

This method sends signal for cashing html tree of categories

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

This method sends category has changed (edit or delete)

Translator
getTranslator()

Returns translator service

string
generateRoute(string $routeName, array $data)

Generate route by name with provided data

mixed
getCategoryObjectsById(array $array)

Get category objects by id

mixed
getFilterForCat(string $slug)

Get category filter for category with slug

mixed
getSuggestedPrices(int $categoryId)

Get suggested prices for category filter by products in that category

mixed
getSuggestedBrandsIds(int $categoryId)

Get suggested brands for category filter

dispatchPromoProductsReCache()

Dispatch promo products cache remove - category of product ca be hidden

dispatchCategoryDisplayChange(Category $category)

Dispatch promo products cache remove - category of product ca be hidden

dispatchGroupProductsUpdate(ProductGroupEvent $productGroupEvent)

Dispatch product group event

boolean
updateDisplayForSubCats(Category $rootCategory)

Update display for subcategories of root given category

dispatchCategoryTreeDecoratorEvent(string $locale)

Dispatch category tree decorator event with locale argument

dispatchCategoryTreeConditionsEvent()

Dispatch category tree conditions event

array
getProducts(string $slug, mixed $newCategory, null $productName = null, bool $isCountSearch = false, array $additionalData = [], int $page = 1, int $offset = 12)

Get products by category slug

array
doProductSearch(ProductSearchWrapper $searchWrapper)

Perform product search

array
doProductSearchCount(ProductSearchWrapper $searchWrapper)

Perform product count

mixed
getSearchSettings()

Get search settings from database

dispatchCategoryEvent(ProductSearchWrapper $searchWrapper)

Dispatch category event

array|string
updateFromCMD()

Update categories from cmd

bool
updateHasVisibleCategories(null $category = null, null $oldParent = null)

Update parent category visibility depending on child categories

array
getCategoryFieldsFromMetadata()

Get category fields from entity metadata

array
getCategoryFieldsForCSVImport()

Get category fields for CSV import Logic when we import categories with name, title, description, parent, etc.

mixed
getCategoryParentImportType()

Get category parent import options for CSV import

mixed
getDBSettingsFields()

Get settings fileds from database

mixed
getCustomCategoryFieldsForExport(array $fields)

Get custom category fields for category export

mixed
getCategoryFromRequestSlug()

Get category slug from request

null|object
getCurrentActiveCategory()

Get category from request slug

array
getAvailableLanguages()

Get available languages

dispatchGenerateTranslationSignal(mixed $responseArray)

Dispatch generate translations signal

mixed
getParentImageWebPathForCategory(int $id)

Get parent image path for category with provided id

mixed
getExternalImageByCatId(int $id)

Get external image by category id

mixed
getExternalParentImageByCatId(int $id)

Get external parent image by category id

mixed
setAllCategoriesToCache()

Set all categories (id and name) to cache

setFooterLayoutToCash()

Set footer layout to cache

setNewRequest(Request $request)

Add new request to request stack

array
searchCategories(Filter $filter, int $page = 1, int $offset = 16, array $ignoreIds = [], null $category = null)

Search categories using Filter and pagination data

array
getAllCategoriesIdAndCode()

Get category id and category code

bool|string
saveMultiple(array $categories, int $flushNumber = 30, bool $hasNewCategories = false)

Save multiple categories

mixed
getCategoryReference(int $id)

Get category object reference by id

dispatchMenuUpdateRemoveSignal(int|string $id, int|string $slug, string|null $name = null)

Dispatch menu update remove signal with id, slug and name

dispatchProductsPermissionsUpdateSignal(array $categories)

Dispatch product permissions update signal

bool
updateProductPermissionsForCategories(string $categories)

Param $categories is a string, example "1,2,4,15"

bool
clearTreeQueryResultCache()

Clear tree query result cache

mixed
getCurrentUser()

Get current logged user

mixed
editFields(Category $category)

Edit category fields for provided category

mixed
getHighestLevelParent(Category $category)

Get highest level parent for category

createRegexEvent(string $regex)

Create regex event

updateCategoryFields(Category $category)

Update category fileds for provided category

bool
mergeMultiple(array $categories)

No description

hideCategoriesForSlug(string $slug, bool $hide = true)

Update hide from menu property to provided state on categories that match provided slug

deleteImagesFromCatGallery(array $images)

Delete Images from category gallery

setImage(Category $category, Image $image)

Set image to category

setGalleryImage(Category $category, Image $image)

Add image to category gallery

setGalleryImages(Category $category, array $images)

Set gallery images to category

setImageForEdit(Category $category)

Set image to category for edit

Details

in JQGridManagerTrait at line 26
mixed searchForJQGRID(array $searchParams, array $sortParams = array(), array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

array $searchParams
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 40
mixed findAllForJQGRID(int $page, int $offset, array $sortParams, array $additionalParams = array(), JQGridWrapper $jqGridWrapper = null)

Parameters

int $page
int $offset
array $sortParams
array $additionalParams
JQGridWrapper $jqGridWrapper

Return Value

mixed

in JQGridManagerTrait at line 53
mixed getCountForJQGRID(array|null $searchParams = null, array|null $sortParams = null, array|null $additionalParams = array(), JQGridWrapper|null $jqGridWrapper = null)

Parameters

array|null $searchParams
array|null $sortParams
array|null $additionalParams
JQGridWrapper|null $jqGridWrapper

Return Value

mixed

array getEntitiesForBlockElementsExtension(array $ids)

Get entities from database by ids

Parameters

array $ids

Return Value

array

array getEntityNamesForIds(array $ids)

Get id and name of entity

Parameters

array $ids

Return Value

array

at line 86
__construct(CategoryRepository $repository, CategoryEventContainer $eventContainer)

Parameters

CategoryRepository $repository
CategoryEventContainer $eventContainer

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

Translate category for key and locale

Parameters

string $key
string $locale

Return Value

string

at line 108
array getAllCategoriesNew()

Get all categories

Return Value

array

at line 117
QueryBuilder findAllCategories()

Returns all objects without additional JOIN query

Return Value

QueryBuilder

at line 130
mixed findAllParentCategories(int $id, int $lft, int $rgt)

Find all parent categories

Parameters

int $id
int $lft
int $rgt

Return Value

mixed

at line 143
array findAllCategoriesWithContainingBrands()

Find all categories with containing brands

Return Value

array

Exceptions

NoResultException
NonUniqueResultException

at line 159
mixed findAllCategoriesIds()

Find all categories ids

Return Value

mixed

at line 168
array getAllCategoriesIdAndName()

Get all categories id and name

Return Value

array

at line 177
array getAllCategoriesIdNameAndDescription()

Get all categories id, name and description

Return Value

array

at line 187
array findAllCategoriesForProductAdd()

Find all categories for product add

Return Value

array

at line 199
Category getDBCategory(Category $category)

Get Category from database

Parameters

Category $category

Return Value

Category

at line 210
mixed getDBCategoryByName(String $categoryName)

Get database category by name

Parameters

String $categoryName

Return Value

mixed

at line 223
mixed getDBCategoryByCode(String $categoryCode)

Get database category by code

Parameters

String $categoryCode

Return Value

mixed

Exceptions

NonUniqueResultException

at line 236
mixed getParentCategorySlug(String $slug)

Get parent category by slug

Parameters

String $slug

Return Value

mixed

Exceptions

DBALException

at line 250
mixed getDBCategoryIDBySlug(Category $category)

Get category id by slug

Parameters

Category $category

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 264
mixed getDBCategoryFilterDataSlug(Category $category)

Get database category filter by slug

Parameters

Category $category

Return Value

mixed

Exceptions

NoResultException
NonUniqueResultException

at line 277
Category getDBCategoryForCategoryPage(Category $category)

Get category for category page

Parameters

Category $category

Return Value

Category

Exceptions

NonUniqueResultException

at line 290
Category deleteCategory(mixed $array)

Delete categories from array

Parameters

mixed $array

Return Value

Category

Exceptions

Exception

at line 320
ArrayCollection getCategoriesGroup(mixed $array)

Get database categories from array

Parameters

mixed $array

Return Value

ArrayCollection

at line 331
array getFeaturedCats(int $max = 6)

Get featured categories

Parameters

int $max

Return Value

array

at line 340
array getAggregatorCategories()

Get first level categories for category aggregator page

Return Value

array

at line 352
array getAllCats(null $rootCats = null)

Get all categories

Parameters

null $rootCats

Return Value

array

at line 361
mixed|void exportToCSV()

Export to CSV

Return Value

mixed|void

at line 372
mixed|void exportCustom(array $data)

Custom export to CSV

Parameters

array $data

Return Value

mixed|void

at line 381
CSVEntityInterface getEntityObject()

Get new Category object

Return Value

CSVEntityInterface

at line 398
mixed importFromCSV(mixed $base64Content, mixed $locale, array $propertyMappings = array(), mixed $importHasParentFiled = false)

Import from CSV with base64 content of a file

Parameters

mixed $base64Content
mixed $locale
array $propertyMappings
mixed $importHasParentFiled

Return Value

mixed

Exceptions

Exception

at line 423
mixed saveObjectsFromCSV(ArrayCollection $objectList, array $csvRow, array $entityCSVHeaders, array $propertyMappings = array())

Persist entities to database

Parameters

ArrayCollection $objectList
array $csvRow
array $entityCSVHeaders
array $propertyMappings

Return Value

mixed

at line 447
array convertFromCSVRowsToTreeWithParentName(array $objectList)

Convert from CSV rows to tree

Parameters

array $objectList

Return Value

array

at line 480
generateIdsForCategoryTreeWithParentName(mixed $parent, array $treeCats)

Generate ids for category tree

Parameters

mixed $parent
array $treeCats

Exceptions

Exception

at line 525
array convertFromCSVRowsToTree(array $objectList)

Convert from CSV rows to tree

Parameters

array $objectList

Return Value

array

Exceptions

NoResultException
NonUniqueResultException

at line 563
generateIdsForCategoryTree(mixed $parent, array $treeCats)

Generate ids for category tree

Parameters

mixed $parent
array $treeCats

Exceptions

Exception

at line 605
QueryBuilder getRootCategories(null $limit = null)

Get root categories

Parameters

null $limit

Return Value

QueryBuilder

at line 618
QueryBuilder getRootFromDb()

Get root category from database

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

at line 630
QueryBuilder getRootObjFromDb()

Get root object from database

Return Value

QueryBuilder

Exceptions

NoResultException
NonUniqueResultException

at line 640
mixed hasRoleAdmin()

Check if logged user has role admin

Return Value

mixed

at line 650
string getCurrentLocale()

Get current locale from request

Return Value

string

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

Get products for category with pagination

Parameters

$id
$page
$offset
$count
$searchParams

Return Value

array

Exceptions

DBALException

at line 682
array sortProductsInCategory(int $categoryId, int $productId, int $newIndex, bool $hasPriority)

Sort products inside category

Parameters

int $categoryId
int $productId
int $newIndex
bool $hasPriority

Return Value

array

Exceptions

DBALException

at line 715
mixed getCategoryFilterPricesByCategory(int $id)

Get category filter prices by category

Parameters

int $id

Return Value

mixed

at line 727
mixed saveTreeCategoryForAdd(Category $category, bool $isCmdAdd = false)

Save tree category for add can be used from cmd

Parameters

Category $category
bool $isCmdAdd

Return Value

mixed

at line 778
array|string getCatsAsTreeForBackend()

Get category tree for backend

Return Value

array|string

at line 800
mixed editCatTree(Category $newCategory, mixed $positionChanged, Category $previous, mixed $removedGalleryImages)

Edit category tree

Parameters

Category $newCategory
mixed $positionChanged
Category $previous
mixed $removedGalleryImages

Return Value

mixed

Exceptions

ORMException
OptimisticLockException

at line 940
removeImageFromDb(Image $image)

Remove image from database

Parameters

Image $image

Exceptions

ORMException
OptimisticLockException

at line 949
setExternalLinksImages(Category $category)

Set external category link images

Parameters

Category $category

at line 973
int deleteTreeCategories(array $ids)

Delete category from tree structure

Parameters

array $ids

Return Value

int

Exceptions

Exception

at line 1038
array|string getAllTreeCategories(array $options, bool|false $displayNonVisible = false)

Get all categories for tree

Parameters

array $options
bool|false $displayNonVisible

Return Value

array|string

at line 1052
array|string getAllTreeCategoriesForCategoryAddTree()

Get all tree categories for add category page

Return Value

array|string

at line 1080
array|null|string getAllTreeCategoriesWithPagination(int|string $id, bool $withRoot, array $options, array $additionalCategories)

Parameters

int|string $id
bool $withRoot
array $options
array $additionalCategories

Return Value

array|null|string

at line 1114
array getLftRgtData($cat)

Parameters

$cat

Return Value

array

Exceptions

NonUniqueResultException

at line 1126
mixed seCashCategoryTree(string $data, string $locale = null)

Set category tree to cache

Parameters

string $data
string $locale

Return Value

mixed

at line 1135
mixed getCashCategoryTree()

Get category tree from cache

Return Value

mixed

at line 1144
mixed getMegaMenuCashCategoryTree()

Get megamenu tree form cache

Return Value

mixed

at line 1153
mixed getAllCatsForFrontend()

Get all categories for frontend

Return Value

mixed

at line 1167
mixed setCacheMegaMenuCategoryTree(string $data, string $locale = null)

Set megamenu categories tree to cache

Parameters

string $data
string $locale

Return Value

mixed

at line 1175
dispatchTeeGenerateSignal()

This method sends signal for cashing html tree of categories

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

This method sends category has changed (edit or delete)

Parameters

array $categories
null $mainCategory
null $oldCategory

at line 1195
Translator getTranslator()

Returns translator service

Return Value

Translator

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

Generate route by name with provided data

Parameters

string $routeName
array $data

Return Value

string

at line 1218
mixed getCategoryObjectsById(array $array)

Get category objects by id

Parameters

array $array

Return Value

mixed

at line 1229
mixed getFilterForCat(string $slug)

Get category filter for category with slug

Parameters

string $slug

Return Value

mixed

at line 1241
mixed getSuggestedPrices(int $categoryId)

Get suggested prices for category filter by products in that category

Parameters

int $categoryId

Return Value

mixed

at line 1260
mixed getSuggestedBrandsIds(int $categoryId)

Get suggested brands for category filter

Parameters

int $categoryId

Return Value

mixed

at line 1268
dispatchPromoProductsReCache()

Dispatch promo products cache remove - category of product ca be hidden

at line 1277
dispatchCategoryDisplayChange(Category $category)

Dispatch promo products cache remove - category of product ca be hidden

Parameters

Category $category

at line 1286
dispatchGroupProductsUpdate(ProductGroupEvent $productGroupEvent)

Dispatch product group event

Parameters

ProductGroupEvent $productGroupEvent

at line 1297
boolean updateDisplayForSubCats(Category $rootCategory)

Update display for subcategories of root given category

Parameters

Category $rootCategory

Return Value

boolean

at line 1308
CategoryEvent dispatchCategoryTreeDecoratorEvent(string $locale)

Dispatch category tree decorator event with locale argument

Parameters

string $locale

Return Value

CategoryEvent

at line 1317
EventWithResult|Event dispatchCategoryTreeConditionsEvent()

Dispatch category tree conditions event

Return Value

EventWithResult|Event

at line 1334
array getProducts(string $slug, mixed $newCategory, null $productName = null, bool $isCountSearch = false, array $additionalData = [], int $page = 1, int $offset = 12)

Get products by category slug

Parameters

string $slug
mixed $newCategory
null $productName
bool $isCountSearch
array $additionalData
int $page
int $offset

Return Value

array

at line 1363
array doProductSearch(ProductSearchWrapper $searchWrapper)

Perform product search

Parameters

ProductSearchWrapper $searchWrapper

Return Value

array

at line 1379
array doProductSearchCount(ProductSearchWrapper $searchWrapper)

Perform product count

Parameters

ProductSearchWrapper $searchWrapper

Return Value

array

at line 1388
mixed getSearchSettings()

Get search settings from database

Return Value

mixed

at line 1399
CategoryPageEvent dispatchCategoryEvent(ProductSearchWrapper $searchWrapper)

Dispatch category event

Parameters

ProductSearchWrapper $searchWrapper

Return Value

CategoryPageEvent

at line 1408
array|string updateFromCMD()

Update categories from cmd

Return Value

array|string

at line 1423
bool updateHasVisibleCategories(null $category = null, null $oldParent = null)

Update parent category visibility depending on child categories

Parameters

null $category
null $oldParent

Return Value

bool

Exceptions

Exception

at line 1463
array getCategoryFieldsFromMetadata()

Get category fields from entity metadata

Return Value

array

at line 1473
array getCategoryFieldsForCSVImport()

Get category fields for CSV import Logic when we import categories with name, title, description, parent, etc.

..

Return Value

array

at line 1494
mixed getCategoryParentImportType()

Get category parent import options for CSV import

Return Value

mixed

at line 1503
mixed getDBSettingsFields()

Get settings fileds from database

Return Value

mixed

at line 1514
mixed getCustomCategoryFieldsForExport(array $fields)

Get custom category fields for category export

Parameters

array $fields

Return Value

mixed

at line 1538
mixed getCategoryFromRequestSlug()

Get category slug from request

Return Value

mixed

at line 1547
null|object getCurrentActiveCategory()

Get category from request slug

Return Value

null|object

at line 1560
array getAvailableLanguages()

Get available languages

Return Value

array

at line 1569
dispatchGenerateTranslationSignal(mixed $responseArray)

Dispatch generate translations signal

Parameters

mixed $responseArray

at line 1582
mixed getParentImageWebPathForCategory(int $id)

Get parent image path for category with provided id

Parameters

int $id

Return Value

mixed

Exceptions

NonUniqueResultException

at line 1596
mixed getExternalImageByCatId(int $id)

Get external image by category id

Parameters

int $id

Return Value

mixed

Exceptions

NonUniqueResultException

at line 1610
mixed getExternalParentImageByCatId(int $id)

Get external parent image by category id

Parameters

int $id

Return Value

mixed

Exceptions

NonUniqueResultException

at line 1620
mixed setAllCategoriesToCache()

Set all categories (id and name) to cache

Return Value

mixed

at line 1630
setFooterLayoutToCash()

Set footer layout to cache

at line 1639
setNewRequest(Request $request)

Add new request to request stack

Parameters

Request $request

at line 1656
array searchCategories(Filter $filter, int $page = 1, int $offset = 16, array $ignoreIds = [], null $category = null)

Search categories using Filter and pagination data

Parameters

Filter $filter
int $page
int $offset
array $ignoreIds
null $category

Return Value

array

See also

Filter

at line 1666
array getAllCategoriesIdAndCode()

Get category id and category code

Return Value

array

at line 1679
bool|string saveMultiple(array $categories, int $flushNumber = 30, bool $hasNewCategories = false)

Save multiple categories

Parameters

array $categories
int $flushNumber
bool $hasNewCategories

Return Value

bool|string

at line 1690
mixed getCategoryReference(int $id)

Get category object reference by id

Parameters

int $id

Return Value

mixed

at line 1701
dispatchMenuUpdateRemoveSignal(int|string $id, int|string $slug, string|null $name = null)

Dispatch menu update remove signal with id, slug and name

Parameters

int|string $id
int|string $slug
string|null $name

at line 1713
dispatchProductsPermissionsUpdateSignal(array $categories)

Dispatch product permissions update signal

Parameters

array $categories

at line 1730
bool updateProductPermissionsForCategories(string $categories)

Param $categories is a string, example "1,2,4,15"

Parameters

string $categories

Return Value

bool

at line 1739
bool clearTreeQueryResultCache()

Clear tree query result cache

Return Value

bool

at line 1748
mixed getCurrentUser()

Get current logged user

Return Value

mixed

at line 1759
mixed editFields(Category $category)

Edit category fields for provided category

Parameters

Category $category

Return Value

mixed

at line 1772
mixed getHighestLevelParent(Category $category)

Get highest level parent for category

Parameters

Category $category

Return Value

mixed

Exceptions

NonUniqueResultException

at line 1783
EventWithResult createRegexEvent(string $regex)

Create regex event

Parameters

string $regex

Return Value

EventWithResult

at line 1794
Category updateCategoryFields(Category $category)

Update category fileds for provided category

Parameters

Category $category

Return Value

Category

at line 1812
bool mergeMultiple(array $categories)

Parameters

array $categories

Return Value

bool

at line 1824
hideCategoriesForSlug(string $slug, bool $hide = true)

Update hide from menu property to provided state on categories that match provided slug

Parameters

string $slug
bool $hide

Exceptions

DBALException

at line 1833
protected deleteImagesFromCatGallery(array $images)

Delete Images from category gallery

Parameters

array $images

at line 1843
protected setImage(Category $category, Image $image)

Set image to category

Parameters

Category $category
Image $image

at line 1861
protected setGalleryImage(Category $category, Image $image)

Add image to category gallery

Parameters

Category $category
Image $image

at line 1879
protected setGalleryImages(Category $category, array $images)

Set gallery images to category

Parameters

Category $category
array $images

at line 1900
protected Category setImageForEdit(Category $category)

Set image to category for edit

Parameters

Category $category

Return Value

Category