From bb7ad3742aeafedb8ee0989d391be40c86cfce2a Mon Sep 17 00:00:00 2001 From: Nicolas MELONI Date: Fri, 2 Feb 2024 10:45:07 +0100 Subject: [PATCH] fix get cached resource issue on family variant --- src/Retriever/FamilyVariantRetriever.php | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/Retriever/FamilyVariantRetriever.php b/src/Retriever/FamilyVariantRetriever.php index 2271d145..0569eb06 100644 --- a/src/Retriever/FamilyVariantRetriever.php +++ b/src/Retriever/FamilyVariantRetriever.php @@ -13,8 +13,6 @@ final class FamilyVariantRetriever implements FamilyVariantRetrieverInterface { - private array $variantsByFamily = []; - public function __construct( private AkeneoPimClientInterface $akeneoPimClient, private LoggerInterface $logger, @@ -25,12 +23,8 @@ public function __construct( public function getVariants(string $familyCode): array { - if ($this->variantsByFamily !== []) { - return $this->variantsByFamily[$familyCode] ?? []; - } - /** @phpstan-ignore-next-line */ - return $this->variantsByFamily[$familyCode] = $this->akeneoFamilyVariants->get(\sprintf(CacheKey::FAMILY_VARIANTS, $familyCode), function () use ($familyCode): array { + return $this->akeneoFamilyVariants->get(\sprintf(CacheKey::FAMILY_VARIANTS, $familyCode), function () use ($familyCode): array { $paginationSize = $this->apiConnectionProvider->get()->getPaginationSize(); try {