Adapter/PlentymarketsAdapter/ResponseParser/Product/ProductResponseParser.php
private function getThirdProductNameAsAttribute(array $product)
    {
        $translations = [];

        foreach ($product['texts'] as $text) {
            $languageIdentifier = $this->identityService->findOneBy([
                'adapterIdentifier' => $text['lang'],
                'adapterName' => PlentymarketsAdapter::NAME,
                'objectType' => Language::TYPE,
            ]);

            if (null === $languageIdentifier) {
                continue;
            }

            $translations[] = Translation::fromArray([
                'languageIdentifier' => $languageIdentifier->getObjectIdentifier(),
                'property' => 'value',
                'value' => $text['name3'],
            ]);
        }

        $attribute = new Attribute();
        $attribute->setKey('thirdProductName');
        $attribute->setValue((string) $product['texts'][0]['name3']);
        $attribute->setTranslations($translations);

        return $attribute;
    }
private function getThirdProductNameAsAttribute(array $product)
    {
        $translations = [];

        foreach ($product['texts'] as $text) {
            $languageIdentifier = $this->identityService->findOneBy([
                'adapterIdentifier' => $text['lang'],
                'adapterName' => PlentymarketsAdapter::NAME,
                'objectType' => Language::TYPE,
            ]);

            if (null === $languageIdentifier) {
                continue;
            }

            $translations[] = Translation::fromArray([
                'languageIdentifier' => $languageIdentifier->getObjectIdentifier(),
                'property' => 'value',
                'value' => $text['name3'],
            ]);
        }

        $attribute = new Attribute();
        $attribute->setKey('thirdProductName');
        $attribute->setValue((string) $product['texts'][0]['name3']);
        $attribute->setTranslations($translations);

        return $attribute;
    }
private function getThirdProductNameAsAttribute ( array $ product ) { $ translations = [ ] ; foreach ( $ product [ 'texts' ] as $ text ) { $ languageIdentifier = $ this -> identityService -> findOneBy ( [ 'adapterIdentifier' => $ text [ 'lang' ] , 'adapterName' => PlentymarketsAdapter :: NAME , 'objectType' => Language :: TYPE , ] ) ; if ( null === $ languageIdentifier ) { continue ; } $ translations [ ] = Translation :: fromArray ( [ 'languageIdentifier' => $ languageIdentifier -> getObjectIdentifier ( ) , 'property' => 'value' , 'value' => $ text [ 'name3' ] , ] ) ; } $ attribute = new Attribute ( ) ; $ attribute -> setKey ( 'thirdProductName' ) ; $ attribute -> setValue ( ( string ) $ product [ 'texts' ] [ 0 ] [ 'name3' ] ) ; $ attribute -> setTranslations ( $ translations ) ; return $ attribute ; }
@param array $product

@return Attribute
@param array $product