TemuProductMapper
in package
Table of Contents
Properties
- $container : mixed
- $em : mixed
Methods
- __construct() : mixed
- buildPriceData() : array<string|int, mixed>
- map() : mixed
- Mappe un objet Product (de ta base) vers le payload attendu par Temu
- buildActualPhotoSection() : array<string|int, mixed>
- buildColorCandidates() : array<string|int, mixed>
- categoryTemplateHasSpecs() : bool
- extractSpecIdFromValue() : int|null
- getBulletPoints() : mixed
- Retourne les bullet points (jusqu'à 5, 200 char max/point)
- getCleanDescription() : mixed
- getProductColor() : string|null
- getSizeCharts() : mixed
- Optionnel : retourne le size chart Temu attendu (vide si pas concerné)
- getSkus() : mixed
- Mappe les SKUs au format Temu
- getTemuCategoryIdForProduct() : mixed
- matchSpecIdFromValues() : int|null
- normalizeTemuString() : string
- resolveSpecIdListForCreation() : array<string|int, mixed>
- resolveSpecIdListForUpdate() : array<string|int, mixed>
- selectFirstSpecId() : int|null
Properties
$container
private
mixed
$container
$em
private
mixed
$em
Methods
__construct()
public
__construct(EntityManagerInterface $em, ContainerInterface $container) : mixed
Parameters
- $em : EntityManagerInterface
- $container : ContainerInterface
buildPriceData()
public
buildPriceData(Product $product, int $temuGoodsId, bool $isUpdate) : array<string|int, mixed>
Parameters
- $product : Product
- $temuGoodsId : int
- $isUpdate : bool
Return values
array<string|int, mixed>map()
Mappe un objet Product (de ta base) vers le payload attendu par Temu
public
map(Product $product[, array<string|int, mixed> $detailImages = [] ][, mixed $temuGoodsId = null ][, mixed $isUpdate = false ][, array<string|int, mixed> $actualLabelImages = [] ][, array<string|int, mixed> $remoteSkuSpecMap = [] ][, array<string|int, mixed> $existingGoodsProperties = [] ][, int|null $overrideTemuCatId = null ][, array<string|int, mixed> $specIds = [] ][, array<string|int, mixed> $goodsProperties = [] ][, array<string|int, mixed> $tradeMarkList = [] ][, array<string|int, mixed> $responsibleInfo = [] ]) : mixed
Parameters
- $product : Product
- $detailImages : array<string|int, mixed> = []
- $temuGoodsId : mixed = null
- $isUpdate : mixed = false
- $actualLabelImages : array<string|int, mixed> = []
- $remoteSkuSpecMap : array<string|int, mixed> = []
- $existingGoodsProperties : array<string|int, mixed> = []
- $overrideTemuCatId : int|null = null
- $specIds : array<string|int, mixed> = []
- $goodsProperties : array<string|int, mixed> = []
- $tradeMarkList : array<string|int, mixed> = []
- $responsibleInfo : array<string|int, mixed> = []
buildActualPhotoSection()
private
buildActualPhotoSection(array<string|int, mixed> $actualLabelImages) : array<string|int, mixed>
Parameters
- $actualLabelImages : array<string|int, mixed>
Return values
array<string|int, mixed>buildColorCandidates()
private
buildColorCandidates(string|null $color) : array<string|int, mixed>
Parameters
- $color : string|null
Return values
array<string|int, mixed>categoryTemplateHasSpecs()
private
categoryTemplateHasSpecs(array<string|int, mixed> $categoryTemplate) : bool
Parameters
- $categoryTemplate : array<string|int, mixed>
Return values
boolextractSpecIdFromValue()
private
extractSpecIdFromValue(array<string|int, mixed> $value) : int|null
Parameters
- $value : array<string|int, mixed>
Return values
int|nullgetBulletPoints()
Retourne les bullet points (jusqu'à 5, 200 char max/point)
private
getBulletPoints(Product $product) : mixed
Parameters
- $product : Product
getCleanDescription()
private
getCleanDescription(Product $product) : mixed
Parameters
- $product : Product
getProductColor()
private
getProductColor(Product $product) : string|null
Parameters
- $product : Product
Return values
string|nullgetSizeCharts()
Optionnel : retourne le size chart Temu attendu (vide si pas concerné)
private
getSizeCharts(Product $product) : mixed
Parameters
- $product : Product
getSkus()
Mappe les SKUs au format Temu
private
getSkus(Product $product, mixed $isUpdate[, array<string|int, mixed> $remoteSkuSpecMap = [] ][, array<string|int, mixed> $specIds = [] ][, mixed $temuGoodsId = null ]) : mixed
Parameters
- $product : Product
- $isUpdate : mixed
- $remoteSkuSpecMap : array<string|int, mixed> = []
- $specIds : array<string|int, mixed> = []
- $temuGoodsId : mixed = null
getTemuCategoryIdForProduct()
private
getTemuCategoryIdForProduct(Product $product) : mixed
Parameters
- $product : Product
matchSpecIdFromValues()
private
matchSpecIdFromValues(array<string|int, mixed> $values, array<string|int, mixed> $normalizedCandidates) : int|null
Parameters
- $values : array<string|int, mixed>
- $normalizedCandidates : array<string|int, mixed>
Return values
int|nullnormalizeTemuString()
private
normalizeTemuString(string|null $value) : string
Parameters
- $value : string|null
Return values
stringresolveSpecIdListForCreation()
private
resolveSpecIdListForCreation(Product $product, array<string|int, mixed> $categoryTemplate) : array<string|int, mixed>
Parameters
- $product : Product
- $categoryTemplate : array<string|int, mixed>
Return values
array<string|int, mixed>resolveSpecIdListForUpdate()
private
resolveSpecIdListForUpdate(Product $product, array<string|int, mixed> $remoteSkuSpecMap, mixed $skuId) : array<string|int, mixed>
Parameters
- $product : Product
- $remoteSkuSpecMap : array<string|int, mixed>
- $skuId : mixed
Return values
array<string|int, mixed>selectFirstSpecId()
private
selectFirstSpecId(array<string|int, mixed> $values) : int|null
Parameters
- $values : array<string|int, mixed>