ProductService
in package
uses
DatatablesExportTrait
Class ProductService
Table of Contents
Constants
- EXPORT_HEADER = ['id' => 'ID', 'img' => 'Photo', 'sku' => 'SKU', 'name' => 'Nom', 'cat' => 'Catégorie', 'qty' => 'Qté', 'price' => 'Prix']
- sameColors = ["Argenté" => 23, "Beige/Marron" => 291, "Beu Foncé" => 25, "Multicouleur" => 254, "Dark" => 24, "Marron clair" => 59, "Fuchsia" => 590]
Properties
- $bigbuyApi : BigbuyApi
- $categoryService : CategoryService
- $configService : ConfigService|object
- $container : ContainerInterface
- $eanProductService : mixed
- AppBundle\Services\EanProductService
- $eventDispatcher : EventDispatcherInterface
- $header : array<string|int, mixed>
- $langs : mixed
- $productService : mixed
- AppBundle\Services\ProductService
- $stores : mixed
- $allCategories : array<string|int, mixed>
- $attributeService : AttributeService
- $bigbuyShippingRateService : ShippingRateService
- $entityManager : EntityManagerInterface
- $productLabelMatchDictionaryService : ProductLabelMatchDictionaryService
- $queueService : QueueServiceInterface
Methods
- __construct() : mixed
- QueueService constructor.
- checkBigBuyDirectory() : mixed
- check if directory exist
- checkBigBuyHasPackaging() : void
- dicionnaryChangeLabelForString() : mixed
- export() : StreamedResponse
- Exporting sales
- exportXls() : mixed
- Exporting as Xls
- generateBodyForShippingRateBigBuyApi() : array<string|int, array<string|int, mixed>>
- generateNewEanForProduct() : string
- getBigBuyMappingData() : array<string|int, mixed>
- getCalculatedPrice() : mixed
- getCategoriesFiles() : mixed
- get Categoriesfiles
- getCategoryProductFullData() : false|string
- getCategoryProductInfoByLang() : false|string
- getDicionnaryLabelle() : mixed
- getFormattedAttributes() : mixed
- Get Formatted Attributes
- getMinimumCarerShippingRate() : array<string|int, mixed>|false
- getOptionsForAttributePack() : array<string|int, mixed>
- getRepo() : ProductRepository
- importBigBuyRelatedCategoryProductsCsv() : mixed
- importProducts() : void
- Import Products
- importProductsCsv() : void
- importProductsDoctrine() : void
- importProductsSql() : void
- initSelection() : array<string|int, mixed>
- initStoreLangCodes() : mixed
- save() : Product
- Save The Entity
- connect() : SFTP
- Connecting by sftp
- exportCsv() : StreamedResponse
- Exporting as csv
- getFinalCategory() : mixed|null
- Get Final category from category ids
Constants
EXPORT_HEADER
public
mixed
EXPORT_HEADER
= ['id' => 'ID', 'img' => 'Photo', 'sku' => 'SKU', 'name' => 'Nom', 'cat' => 'Catégorie', 'qty' => 'Qté', 'price' => 'Prix']
sameColors
public
mixed
sameColors
= ["Argenté" => 23, "Beige/Marron" => 291, "Beu Foncé" => 25, "Multicouleur" => 254, "Dark" => 24, "Marron clair" => 59, "Fuchsia" => 590]
Properties
$bigbuyApi
protected
BigbuyApi
$bigbuyApi
$categoryService
protected
CategoryService
$categoryService
$configService
protected
ConfigService|object
$configService
$container
protected
ContainerInterface
$container
$eanProductService
AppBundle\Services\EanProductService
protected
mixed
$eanProductService
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$header
protected
array<string|int, mixed>
$header
= []
$langs
protected
mixed
$langs
= []
$productService
AppBundle\Services\ProductService
protected
mixed
$productService
$stores
protected
mixed
$stores
= []
$allCategories
private
array<string|int, mixed>
$allCategories
= []
$attributeService
private
AttributeService
$attributeService
$bigbuyShippingRateService
private
ShippingRateService
$bigbuyShippingRateService
$entityManager
private
EntityManagerInterface
$entityManager
$productLabelMatchDictionaryService
private
ProductLabelMatchDictionaryService
$productLabelMatchDictionaryService
$queueService
private
QueueServiceInterface
$queueService
Methods
__construct()
QueueService constructor.
public
__construct(ContainerInterface $container, EntityManagerInterface $entityManager, BigbuyApi $bigbuyApi, CategoryService $categoryService, AttributeService $attributeService, QueueServiceInterface $queueService, ProductLabelMatchDictionaryService $productLabelMatchDictionaryService, ShippingRateService $bigbuyShippingRateService, EventDispatcherInterface $eventDispatcher, EanProductService $eanProductService) : mixed
Parameters
- $container : ContainerInterface
- $entityManager : EntityManagerInterface
- $bigbuyApi : BigbuyApi
- $categoryService : CategoryService
- $attributeService : AttributeService
- $queueService : QueueServiceInterface
- $productLabelMatchDictionaryService : ProductLabelMatchDictionaryService
- $bigbuyShippingRateService : ShippingRateService
- $eventDispatcher : EventDispatcherInterface
- $eanProductService : EanProductService
checkBigBuyDirectory()
check if directory exist
public
checkBigBuyDirectory() : mixed
checkBigBuyHasPackaging()
public
checkBigBuyHasPackaging(mixed $id, mixed $stock) : void
Parameters
- $id : mixed
- $stock : mixed
dicionnaryChangeLabelForString()
public
dicionnaryChangeLabelForString(mixed $string) : mixed
Parameters
- $string : mixed
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
generateBodyForShippingRateBigBuyApi()
public
generateBodyForShippingRateBigBuyApi(mixed $codeCountry, mixed $sku, mixed $qty) : array<string|int, array<string|int, mixed>>
Parameters
- $codeCountry : mixed
- $sku : mixed
- $qty : mixed
Return values
array<string|int, array<string|int, mixed>>generateNewEanForProduct()
public
generateNewEanForProduct(mixed $sku) : string
Parameters
- $sku : mixed
Tags
Return values
stringgetBigBuyMappingData()
public
getBigBuyMappingData(array<string|int, mixed> $products, mixed $bigBuyProduct[, array<string|int, mixed> $color = [] ][, array<string|int, mixed> $format = [] ], mixed $pack) : array<string|int, mixed>
Parameters
- $products : array<string|int, mixed>
- $bigBuyProduct : mixed
- $color : array<string|int, mixed> = []
- $format : array<string|int, mixed> = []
- $pack : mixed
Tags
Return values
array<string|int, mixed>getCalculatedPrice()
public
getCalculatedPrice() : mixed
getCategoriesFiles()
get Categoriesfiles
public
getCategoriesFiles() : mixed
getCategoryProductFullData()
public
getCategoryProductFullData(mixed $categoryId, mixed $product, mixed $images) : false|string
Parameters
- $categoryId : mixed
- $product : mixed
- $images : mixed
Return values
false|stringgetCategoryProductInfoByLang()
public
getCategoryProductInfoByLang(mixed $categoryId, mixed $productId, mixed $lang) : false|string
Parameters
- $categoryId : mixed
- $productId : mixed
- $lang : mixed
Return values
false|stringgetDicionnaryLabelle()
public
getDicionnaryLabelle() : mixed
getFormattedAttributes()
Get Formatted Attributes
public
getFormattedAttributes() : mixed
getMinimumCarerShippingRate()
public
getMinimumCarerShippingRate(mixed $data) : array<string|int, mixed>|false
Parameters
- $data : mixed
Return values
array<string|int, mixed>|falsegetOptionsForAttributePack()
public
getOptionsForAttributePack() : array<string|int, mixed>
Return values
array<string|int, mixed>getRepo()
public
getRepo() : ProductRepository
Return values
ProductRepositoryimportBigBuyRelatedCategoryProductsCsv()
public
importBigBuyRelatedCategoryProductsCsv(mixed $categoryId) : mixed
Parameters
- $categoryId : mixed
Tags
importProducts()
Import Products
public
importProducts([string $style = 'csv' ][, mixed $onlyCreatedProducts = false ]) : void
Parameters
- $style : string = 'csv'
- $onlyCreatedProducts : mixed = false
Tags
importProductsCsv()
public
importProductsCsv([bool $onlyCreatedProducts = false ]) : void
Parameters
- $onlyCreatedProducts : bool = false
Tags
importProductsDoctrine()
public
importProductsDoctrine() : void
importProductsSql()
public
importProductsSql() : void
Tags
initSelection()
public
initSelection(mixed $session) : array<string|int, mixed>
Parameters
- $session : mixed
Return values
array<string|int, mixed>initStoreLangCodes()
public
initStoreLangCodes() : mixed
save()
Save The Entity
public
save(Product $product) : Product
Parameters
- $product : Product
Return values
Productconnect()
Connecting by sftp
private
connect() : SFTP
Return values
SFTPexportCsv()
Exporting as csv
private
exportCsv(mixed $data, mixed $columns, mixed $title) : StreamedResponse
Parameters
- $data : mixed
- $columns : mixed
- $title : mixed
Return values
StreamedResponsegetFinalCategory()
Get Final category from category ids
private
getFinalCategory(mixed $categoryIds) : mixed|null
Parameters
- $categoryIds : mixed