CategoryService
extends TransactionalService
in package
Class CategoryService
Table of Contents
Properties
- $arrayDefaultConfig : array<string|int, array<string|int, int>>
- $categoryRepository : CategoryRepository
- $container : mixed
- $em : EntityManager
- $header : mixed
Methods
- addRepository() : void
- Add a repository to this service
- addService() : void
- Add a service to this service
- addSubCateghoryToCategory() : void
- checkFormConfigCategory() : false|string
- construct() : mixed
- category constructor.
- export() : StreamedResponse
- Exporting sales
- exportXls() : mixed
- Exporting as Xls
- findCategoryToAdd() : void
- findCategoryToUpdate() : array<string|int, mixed>|false
- generateBlockCategoryHtml() : string
- generateNewCategoryFromArrayJson() : array<string|int, mixed>
- generateOptionSelectForPosition() : string
- getCategoriesAsTree() : mixed
- getEntityManager() : EntityManager
- Getter of the Entity Manager
- getMenzzoMenu() : array<string|int, mixed>
- getParentCategoryConfig() : string
- getRepo() : mixed
- Get ProductRepository
- removeSubCategory() : void
- renderMenuItem() : string
- save() : Category
- Save a Product
- saveCategoriesFromApi() : bool
- Saving category information from menzzo API
- setEntityManager() : mixed
- Setter of the Entity Manager
- updateConfigCat() : array<string|int, mixed>|false
- updateImageCategory() : void
- updateParentConfigCat() : void
- updatePrincipalCat() : void
- exportCsv() : mixed
- Exporting as csv
Properties
$arrayDefaultConfig
public
array<string|int, array<string|int, int>>
$arrayDefaultConfig
= ['menzzo' => ['value' => 60, 'position' => 1], 'asir' => ['value' => 30, 'position' => 2], 'dropShip' => ['value' => 10, 'position' => 3]]
$categoryRepository
protected
CategoryRepository
$categoryRepository
$container
protected
mixed
$container
$em
protected
EntityManager
$em
The Entity Manager
$header
private
mixed
$header
= ['id' => 'ID', 'name' => 'Nom', 'level' => 'Niveau', 'is_active' => 'Active', 'include_in_menu' => 'Afficher dans le menu', 'up_stairs_extra_shipping_amount' => 'Frais de port']
Methods
addRepository()
Add a repository to this service
public
addRepository(int $key, string $class) : void
Parameters
- $key : int
-
Key
- $class : string
-
Class
addService()
Add a service to this service
public
addService(int $key, mixed $service) : void
Parameters
- $key : int
-
Key
- $service : mixed
addSubCateghoryToCategory()
public
addSubCateghoryToCategory(mixed $category, mixed $categoryToAdd, mixed $colum, mixed $menuCategory, mixed $needTranslate, mixed $storeId, mixed $categoryMenu) : void
Parameters
- $category : mixed
- $categoryToAdd : mixed
- $colum : mixed
- $menuCategory : mixed
- $needTranslate : mixed
- $storeId : mixed
- $categoryMenu : mixed
checkFormConfigCategory()
public
checkFormConfigCategory(mixed $arrayConfig) : false|string
Parameters
- $arrayConfig : mixed
Return values
false|stringconstruct()
category constructor.
public
construct(ContainerInterface $container) : mixed
Parameters
- $container : ContainerInterface
export()
Exporting sales
public
export(mixed $title, mixed $data, mixed $columns, mixed $format[, array<string|int, mixed> $customHeader = [] ]) : StreamedResponse
Parameters
- $title : mixed
- $data : mixed
- $columns : mixed
- $format : mixed
- $customHeader : array<string|int, mixed> = []
Return values
StreamedResponseexportXls()
Exporting as Xls
public
exportXls(mixed $data, mixed $columns, mixed $title[, bool $toFile = false ]) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
- $toFile : bool = false
findCategoryToAdd()
public
findCategoryToAdd(mixed $idCat, mixed $menu) : void
Parameters
- $idCat : mixed
- $menu : mixed
findCategoryToUpdate()
public
findCategoryToUpdate(mixed $catId, mixed $resultKey[, mixed $storeId = 3 ]) : array<string|int, mixed>|false
Parameters
- $catId : mixed
- $resultKey : mixed
- $storeId : mixed = 3
Return values
array<string|int, mixed>|falsegenerateBlockCategoryHtml()
public
generateBlockCategoryHtml(mixed $blockHtml, mixed $html, mixed $catPrincipalId, mixed $columBlock) : string
Parameters
- $blockHtml : mixed
- $html : mixed
- $catPrincipalId : mixed
- $columBlock : mixed
Return values
stringgenerateNewCategoryFromArrayJson()
public
generateNewCategoryFromArrayJson(mixed $jsonMenu) : array<string|int, mixed>
Parameters
- $jsonMenu : mixed
Return values
array<string|int, mixed>generateOptionSelectForPosition()
public
generateOptionSelectForPosition(mixed $typProductPosition) : string
Parameters
- $typProductPosition : mixed
Return values
stringgetCategoriesAsTree()
public
getCategoriesAsTree() : mixed
getEntityManager()
Getter of the Entity Manager
public
getEntityManager() : EntityManager
Return values
EntityManagergetMenzzoMenu()
public
getMenzzoMenu([mixed $storeId = 3 ]) : array<string|int, mixed>
Parameters
- $storeId : mixed = 3
Return values
array<string|int, mixed>getParentCategoryConfig()
public
getParentCategoryConfig(mixed $parentCategory) : string
Parameters
- $parentCategory : mixed
Return values
stringgetRepo()
Get ProductRepository
public
getRepo() : mixed
removeSubCategory()
public
removeSubCategory(mixed $catgToDelate, mixed $resultCat, mixed $menuTree, mixed $parent, mixed $colum) : void
Parameters
- $catgToDelate : mixed
- $resultCat : mixed
- $menuTree : mixed
- $parent : mixed
- $colum : mixed
renderMenuItem()
public
renderMenuItem(mixed $id, mixed $label, mixed $url, mixed $children, mixed $percentageConfig[, mixed $level = false ][, mixed $hideSubCategory = '0' ], mixed $parentIdCat, mixed $colum, mixed $position, mixed $image) : string
Parameters
- $id : mixed
- $label : mixed
- $url : mixed
- $children : mixed
- $percentageConfig : mixed
- $level : mixed = false
- $hideSubCategory : mixed = '0'
- $parentIdCat : mixed
- $colum : mixed
- $position : mixed
- $image : mixed
Return values
stringsave()
Save a Product
public
save(Category $category) : Category
Parameters
- $category : Category
Tags
Return values
CategorysaveCategoriesFromApi()
Saving category information from menzzo API
public
saveCategoriesFromApi(mixed $datas) : bool
Parameters
- $datas : mixed
Tags
Return values
boolsetEntityManager()
Setter of the Entity Manager
public
setEntityManager(EntityManager $em) : mixed
Parameters
- $em : EntityManager
-
the Entity Manager
updateConfigCat()
public
updateConfigCat(mixed $arrayConfig, mixed $url, mixed $nom, mixed $catId, mixed $resultKey, mixed $storeId, mixed $parentCateg) : array<string|int, mixed>|false
Parameters
- $arrayConfig : mixed
- $url : mixed
- $nom : mixed
- $catId : mixed
- $resultKey : mixed
- $storeId : mixed
- $parentCateg : mixed
Return values
array<string|int, mixed>|falseupdateImageCategory()
public
updateImageCategory(mixed $categoryForImage, mixed $resultCat, mixed $menuTree, mixed $parent, mixed $colum, mixed $val) : void
Parameters
- $categoryForImage : mixed
- $resultCat : mixed
- $menuTree : mixed
- $parent : mixed
- $colum : mixed
- $val : mixed
updateParentConfigCat()
public
updateParentConfigCat(mixed $menuTree, mixed $idCatg, mixed $arrayConfig) : void
Parameters
- $menuTree : mixed
- $idCatg : mixed
- $arrayConfig : mixed
updatePrincipalCat()
public
updatePrincipalCat(mixed $updateMenu, mixed $jsonMenu, mixed $resultKey, mixed &$cloneMenu[, mixed $storeId = 3 ]) : void
Parameters
- $updateMenu : mixed
- $jsonMenu : mixed
- $resultKey : mixed
- $cloneMenu : mixed
- $storeId : mixed = 3
exportCsv()
Exporting as csv
private
exportCsv(mixed $data, mixed $columns, mixed $title) : mixed
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed