Components/Bundle/PlentymarketsAdapter/ResponseParser/BundleResponseParser.php
private function parseBundle(array $variation, array $product)
    {
        $identity = $this->identityService->findOneOrCreate(
            (string) $variation['id'],
            PlentymarketsAdapter::NAME,
            Bundle::TYPE
        );

        $productIdentity = $this->identityService->findOneBy([
            'adapterIdentifier' => (string) $product['id'],
            'adapterName' => PlentymarketsAdapter::NAME,
            'objectType' => Product::TYPE,
        ]);

        if (null === $productIdentity) {
            $this->logger->notice('product not found', ['bundle' => $variation]);

            return null;
        }

        $bundle = new Bundle();
        $bundle->setIdentifier($identity->getObjectIdentifier());
        $bundle->setName($product['texts'][0]['name1']);
        $bundle->setNumber($variation['number']);
        $bundle->setPosition($variation['position']);
        $bundle->setStockLimitation((bool) $variation['stockLimitation']);
        $bundle->setPrices($this->priceResponseParser->parse($variation));
        $bundle->setVatRateIdentifier($this->getVatRateIdentifier($variation));
        $bundle->setProductIdentifier($productIdentity->getObjectIdentifier());
        $bundle->setAvailableFrom($this->getAvailableFrom($variation));
        $bundle->setAvailableTo($this->getAvailableTo($variation));
        $bundle->setBundleProducts($this->getBundleProducts($variation));
        $bundle->setTranslations($this->getTranslations($product));

        return $bundle;
    }
private function parseBundle(array $variation, array $product)
    {
        $identity = $this->identityService->findOneOrCreate(
            (string) $variation['id'],
            PlentymarketsAdapter::NAME,
            Bundle::TYPE
        );

        $productIdentity = $this->identityService->findOneBy([
            'adapterIdentifier' => (string) $product['id'],
            'adapterName' => PlentymarketsAdapter::NAME,
            'objectType' => Product::TYPE,
        ]);

        if (null === $productIdentity) {
            $this->logger->notice('product not found', ['bundle' => $variation]);

            return null;
        }

        $bundle = new Bundle();
        $bundle->setIdentifier($identity->getObjectIdentifier());
        $bundle->setName($product['texts'][0]['name1']);
        $bundle->setNumber($variation['number']);
        $bundle->setPosition($variation['position']);
        $bundle->setStockLimitation((bool) $variation['stockLimitation']);
        $bundle->setPrices($this->priceResponseParser->parse($variation));
        $bundle->setVatRateIdentifier($this->getVatRateIdentifier($variation));
        $bundle->setProductIdentifier($productIdentity->getObjectIdentifier());
        $bundle->setAvailableFrom($this->getAvailableFrom($variation));
        $bundle->setAvailableTo($this->getAvailableTo($variation));
        $bundle->setBundleProducts($this->getBundleProducts($variation));
        $bundle->setTranslations($this->getTranslations($product));

        return $bundle;
    }
@param array $variation
@param array $product

@return null|Bundle