*/ private array $sourceAttributes; /** * Construct an import candidate. * * @param string $provider Stable provider key. * @param string $providerItemId Provider-side identifier. * @param string $title Product title. * @param string|null $brand Brand or manufacturer. * @param string $detailUrl Provider detail URL. * @param string|null $affiliateUrl Affiliate-tracked URL. * @param string|null $imageUrl Primary image URL. * @param string|null $priceAmount Decimal price amount. * @param array $sourceAttributes Original block attributes. */ public function __construct( string $provider, string $providerItemId, string $title, ?string $brand, string $detailUrl, ?string $affiliateUrl, ?string $imageUrl, ?string $priceAmount, array $sourceAttributes ) { $this->provider = $provider; $this->providerItemId = $providerItemId; $this->title = $title; $this->brand = $brand; $this->detailUrl = $detailUrl; $this->affiliateUrl = $affiliateUrl; $this->imageUrl = $imageUrl; $this->priceAmount = $priceAmount; $this->sourceAttributes = $sourceAttributes; } /** * Stable provider key. */ public function provider(): string { return $this->provider; } /** * Provider-side product identifier. */ public function providerItemId(): string { return $this->providerItemId; } /** * Product title. */ public function title(): string { return $this->title; } /** * Brand or manufacturer name. */ public function brand(): ?string { return $this->brand; } /** * Provider detail URL. */ public function detailUrl(): string { return $this->detailUrl; } /** * Affiliate-tracked URL. */ public function affiliateUrl(): ?string { return $this->affiliateUrl; } /** * Primary image URL. */ public function imageUrl(): ?string { return $this->imageUrl; } /** * Decimal price amount. */ public function priceAmount(): ?string { return $this->priceAmount; } /** * @return array */ public function sourceAttributes(): array { return $this->sourceAttributes; } /** * Stable deduplication key. */ public function identityKey(): string { return $this->provider . "\0" . $this->providerItemId; } }