Adapter/PlentymarketsAdapter/ResponseParser/Manufacturer/ManufacturerResponseParser.php
public function parse(array $entry)
    {
        $identity = $this->identityService->findOneOrCreate(
            (string) $entry['id'],
            PlentymarketsAdapter::NAME,
            Manufacturer::TYPE
        );

        $manufacturer = new Manufacturer();
        $manufacturer->setIdentifier($identity->getObjectIdentifier());
        $manufacturer->setName($entry['name']);

        if (!empty($entry['url'])) {
            $manufacturer->setLink($entry['url']);
        }

        $result = [];

        if (!empty($entry['logo'])) {
            try {
                $media = $this->mediaResponseParser->parse([
                    'mediaCategory' => MediaCategoryHelper::MANUFACTURER,
                    'id' => $entry['id'],
                    'link' => $entry['logo'],
                    'name' => $entry['name'],
                    'alternateName' => $entry['name'],
                ]);

                $manufacturer->setLogoIdentifier($media->getIdentifier());

                $result[] = $media;
            } catch (Exception $exception) {
                $this->logger->notice('error while processing manufacturer logo', [
                    'name' => $entry['name'],
                    'url' => $entry['logo'],
                ]);
            }
        }

        $result[] = $manufacturer;

        return $result;
    }
public function parse(array $entry)
    {
        $identity = $this->identityService->findOneOrCreate(
            (string) $entry['id'],
            PlentymarketsAdapter::NAME,
            Manufacturer::TYPE
        );

        $manufacturer = new Manufacturer();
        $manufacturer->setIdentifier($identity->getObjectIdentifier());
        $manufacturer->setName($entry['name']);

        if (!empty($entry['url'])) {
            $manufacturer->setLink($entry['url']);
        }

        $result = [];

        if (!empty($entry['logo'])) {
            try {
                $media = $this->mediaResponseParser->parse([
                    'mediaCategory' => MediaCategoryHelper::MANUFACTURER,
                    'id' => $entry['id'],
                    'link' => $entry['logo'],
                    'name' => $entry['name'],
                    'alternateName' => $entry['name'],
                ]);

                $manufacturer->setLogoIdentifier($media->getIdentifier());

                $result[] = $media;
            } catch (Exception $exception) {
                $this->logger->notice('error while processing manufacturer logo', [
                    'name' => $entry['name'],
                    'url' => $entry['logo'],
                ]);
            }
        }

        $result[] = $manufacturer;

        return $result;
    }
{@inheritdoc}