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

        for ($i = 0; $i < 20; ++$i) {
            $key = 'free' . ($i + 1);

            if (!array_key_exists($key, $product)) {
                continue;
            }

            $attributes[] = Attribute::fromArray([
                'key' => $key,
                'value' => (string) $product[$key],
            ]);
        }

        $attributes[] = $this->getShortDescriptionAsAttribute($product);
        $attributes[] = $this->getTechnicalDataAsAttribute($product);
        $attributes[] = $this->getAgeRestrictionAsAttribute($product);
        $attributes[] = $this->getSecondProductNameAsAttribute($product);
        $attributes[] = $this->getThirdProductNameAsAttribute($product);
        $attributes[] = $this->getItemIdAsAttribute($product);

        return $attributes;
    }
private function getAttributes(array $product)
    {
        $attributes = [];

        for ($i = 0; $i < 20; ++$i) {
            $key = 'free' . ($i + 1);

            if (!array_key_exists($key, $product)) {
                continue;
            }

            $attributes[] = Attribute::fromArray([
                'key' => $key,
                'value' => (string) $product[$key],
            ]);
        }

        $attributes[] = $this->getShortDescriptionAsAttribute($product);
        $attributes[] = $this->getTechnicalDataAsAttribute($product);
        $attributes[] = $this->getAgeRestrictionAsAttribute($product);
        $attributes[] = $this->getSecondProductNameAsAttribute($product);
        $attributes[] = $this->getThirdProductNameAsAttribute($product);
        $attributes[] = $this->getItemIdAsAttribute($product);

        return $attributes;
    }
private function getAttributes ( array $ product ) { $ attributes = [ ] ; for ( $ i = 0 ; $ i < 20 ; ++ $ i ) { $ key = 'free' . ( $ i + 1 ) ; if ( ! array_key_exists ( $ key , $ product ) ) { continue ; } $ attributes [ ] = Attribute :: fromArray ( [ 'key' => $ key , 'value' => ( string ) $ product [ $ key ] , ] ) ; } $ attributes [ ] = $ this -> getShortDescriptionAsAttribute ( $ product ) ; $ attributes [ ] = $ this -> getTechnicalDataAsAttribute ( $ product ) ; $ attributes [ ] = $ this -> getAgeRestrictionAsAttribute ( $ product ) ; $ attributes [ ] = $ this -> getSecondProductNameAsAttribute ( $ product ) ; $ attributes [ ] = $ this -> getThirdProductNameAsAttribute ( $ product ) ; $ attributes [ ] = $ this -> getItemIdAsAttribute ( $ product ) ; return $ attributes ; }
@param array $product

@return Attribute[]
@param array $product