TemuCategoryInspector
in package
Service utilitaire permettant de parcourir les catégories Temu en cache et de vérifier la présence de specId (goodsSpecProperties) sur les feuilles.
Table of Contents
Properties
- $apiClient : TemuApiClient
- $childrenCache : array<int|string, array<int, array<string, mixed>>>
- $language : string
- $templateCache : array<int, array<string, mixed>|null>
Methods
- __construct() : mixed
- getChildren() : array<int, array<string, mixed>>
- Retourne les enfants directs d'une catégorie (avec mise en cache).
- getTemplate() : array<string, mixed>|null
- Récupère la template Temu (avec cache).
- hasSpecs() : mixed
- Détermine si une catégorie Temu possède au moins un specId.
- setLanguage() : mixed
- normalizeCategory() : array<string, mixed>
- Normalise la structure d'une catégorie Temu.
Properties
$apiClient
private
TemuApiClient
$apiClient
$childrenCache
private
array<int|string, array<int, array<string, mixed>>>
$childrenCache
= array()
$language
private
string
$language
$templateCache
private
array<int, array<string, mixed>|null>
$templateCache
= array()
Methods
__construct()
public
__construct(TemuApiClient $apiClient[, mixed $language = 'en' ]) : mixed
Parameters
- $apiClient : TemuApiClient
- $language : mixed = 'en'
getChildren()
Retourne les enfants directs d'une catégorie (avec mise en cache).
public
getChildren(int|null $parentCatId) : array<int, array<string, mixed>>
Parameters
- $parentCatId : int|null
Return values
array<int, array<string, mixed>>getTemplate()
Récupère la template Temu (avec cache).
public
getTemplate(int $catId) : array<string, mixed>|null
Parameters
- $catId : int
Return values
array<string, mixed>|nullhasSpecs()
Détermine si une catégorie Temu possède au moins un specId.
public
hasSpecs(mixed $catId) : mixed
Parameters
- $catId : mixed
setLanguage()
public
setLanguage(mixed $language) : mixed
Parameters
- $language : mixed
normalizeCategory()
Normalise la structure d'une catégorie Temu.
private
normalizeCategory(array<string, mixed> $raw, int|null $fallbackParent) : array<string, mixed>
Parameters
- $raw : array<string, mixed>
- $fallbackParent : int|null