ProductService
in package
uses
DatatablesExportTrait
Table of Contents
Constants
- EXPORT_HEADER = ['id' => 'ID', 'img' => 'Photo', 'sku' => 'SKU', 'name' => 'Nom', 'cat' => 'Catégorie', 'qty' => 'Qté', 'price' => 'Prix']
- FEED_URL = 'http://transport.productsup.io/48ab79321df6c10b2211/channel/188040/vidaXL_fr_dropshipping.csv'
- FEED_URLS = [3 => 'http://transport.productsup.io/48ab79321df6c10b2211/channel/188040/vidaXL_fr_dropshipping.csv', 2 => 'http://transport.productsup.io/8227eda6a7fa10d0d996/channel/188057/vidaXL_de_dropshipping.csv', 25 => 'http://transport.productsup.io/cf7871c3eb59dc3fd0e5/channel/188055/vidaXL_nl_dropshipping.csv', 14 => 'http://transport.productsup.io/bd06690795dfeb1b0f28/channel/188046/vidaXL_it_dropshipping.csv', 28 => 'http://transport.productsup.io/bd06690795dfeb1b0f28/channel/188046/vidaXL_it_dropshipping.csv', 29 => 'http://transport.productsup.io/7947c7becca20572b9b6/channel/188064/vidaXL_es_dropshipping.csv', 23 => 'http://transport.productsup.io/beb10746e58fc0fa8ef8/channel/188062/vidaXL_be_fr_dropshipping.csv', 26 => 'http://transport.productsup.io/beb10746e58fc0fa8ef8/channel/188060/vidaXL_be_nl_dropshipping.csv']
- sameColors = ["Argenté" => 23, "Beige/Marron" => 291, "Beu Foncé" => 25, "Multicouleur" => 254, "Dark" => 24, "Marron clair" => 59, "Fuchsia" => 590]
Properties
- $container : ContainerInterface
- $eventDispatcher : EventDispatcherInterface
- $header : array<string|int, mixed>
- $productService : mixed
- AppBundle\Services\ProductService
- $allCategories : array<string|int, mixed>
- $attributeService : AttributeService
- $categoryService : CategoryService
- $configService : ConfigService|object
- $entityManager : EntityManagerInterface
- $productFeedDir : mixed
- $productFeedDirPath : string
- $productFeedFile : mixed
- $queueService : QueueServiceInterface
- $stores : mixed
- $vidaxlApi : VidaxlApi
Methods
- __construct() : mixed
- checkFeedDirectory() : mixed
- check if directory exist
- downloadFeed() : mixed
- export() : StreamedResponse
- Exporting sales
- exportXls() : mixed
- Exporting as Xls
- getCategoryProductFullData() : false|string
- getDimensionsTotale() : array<string|int, mixed>
- getRepo() : ProductRepository
- getVidaxlMappingData() : array<string|int, mixed>
- importProductVidaxl() : void
- initSelection() : array<string|int, mixed>
- save() : Product
- Save The Entity
- setDimensionNewProduct() : mixed
- 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']
FEED_URL
public
mixed
FEED_URL
= 'http://transport.productsup.io/48ab79321df6c10b2211/channel/188040/vidaXL_fr_dropshipping.csv'
FEED_URLS
public
mixed
FEED_URLS
= [3 => 'http://transport.productsup.io/48ab79321df6c10b2211/channel/188040/vidaXL_fr_dropshipping.csv', 2 => 'http://transport.productsup.io/8227eda6a7fa10d0d996/channel/188057/vidaXL_de_dropshipping.csv', 25 => 'http://transport.productsup.io/cf7871c3eb59dc3fd0e5/channel/188055/vidaXL_nl_dropshipping.csv', 14 => 'http://transport.productsup.io/bd06690795dfeb1b0f28/channel/188046/vidaXL_it_dropshipping.csv', 28 => 'http://transport.productsup.io/bd06690795dfeb1b0f28/channel/188046/vidaXL_it_dropshipping.csv', 29 => 'http://transport.productsup.io/7947c7becca20572b9b6/channel/188064/vidaXL_es_dropshipping.csv', 23 => 'http://transport.productsup.io/beb10746e58fc0fa8ef8/channel/188062/vidaXL_be_fr_dropshipping.csv', 26 => 'http://transport.productsup.io/beb10746e58fc0fa8ef8/channel/188060/vidaXL_be_nl_dropshipping.csv']
sameColors
public
mixed
sameColors
= ["Argenté" => 23, "Beige/Marron" => 291, "Beu Foncé" => 25, "Multicouleur" => 254, "Dark" => 24, "Marron clair" => 59, "Fuchsia" => 590]
Properties
$container
protected
ContainerInterface
$container
$eventDispatcher
protected
EventDispatcherInterface
$eventDispatcher
$header
protected
array<string|int, mixed>
$header
= []
$productService
AppBundle\Services\ProductService
protected
mixed
$productService
$allCategories
private
array<string|int, mixed>
$allCategories
$attributeService
private
AttributeService
$attributeService
$categoryService
private
CategoryService
$categoryService
$configService
private
ConfigService|object
$configService
$entityManager
private
EntityManagerInterface
$entityManager
$productFeedDir
private
mixed
$productFeedDir
$productFeedDirPath
private
string
$productFeedDirPath
$productFeedFile
private
mixed
$productFeedFile
$queueService
private
QueueServiceInterface
$queueService
$stores
private
mixed
$stores
$vidaxlApi
private
VidaxlApi
$vidaxlApi
Methods
__construct()
public
__construct(ContainerInterface $container, QueueServiceInterface $queueService, EntityManagerInterface $entityManager, AttributeService $attributeService, CategoryService $categoryService, VidaxlApi $vidaxlApi, EventDispatcherInterface $eventDispatcher) : mixed
Parameters
- $container : ContainerInterface
- $queueService : QueueServiceInterface
- $entityManager : EntityManagerInterface
- $attributeService : AttributeService
- $categoryService : CategoryService
- $vidaxlApi : VidaxlApi
- $eventDispatcher : EventDispatcherInterface
checkFeedDirectory()
check if directory exist
public
checkFeedDirectory() : mixed
downloadFeed()
public
downloadFeed() : 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
getCategoryProductFullData()
public
getCategoryProductFullData(mixed $categoryId, mixed $product, mixed $images) : false|string
Parameters
- $categoryId : mixed
- $product : mixed
- $images : mixed
Return values
false|stringgetDimensionsTotale()
public
getDimensionsTotale(mixed $product) : array<string|int, mixed>
Parameters
- $product : mixed
Return values
array<string|int, mixed>getRepo()
public
getRepo() : ProductRepository
Return values
ProductRepositorygetVidaxlMappingData()
public
getVidaxlMappingData(Product $vidaxlProduct[, array<string|int, mixed> $color = [] ]) : array<string|int, mixed>
Parameters
- $vidaxlProduct : Product
- $color : array<string|int, mixed> = []
Return values
array<string|int, mixed>importProductVidaxl()
public
importProductVidaxl([false $onlyCreatedProducts = false ]) : void
Parameters
- $onlyCreatedProducts : false = false
Tags
initSelection()
public
initSelection(mixed $session) : array<string|int, mixed>
Parameters
- $session : mixed
Return values
array<string|int, mixed>save()
Save The Entity
public
save(Product $catalog) : Product
Parameters
- $catalog : Product
Return values
ProductsetDimensionNewProduct()
public
setDimensionNewProduct(mixed $p, mixed $dimensionsTotale, mixed $vidaxlProduct) : mixed
Parameters
- $p : mixed
- $dimensionsTotale : mixed
- $vidaxlProduct : mixed
exportCsv()
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