use Shopware\Bundle\StoreFrontBundle\Struct\Extendable;
class AttributeHydrator extends Hydrator
{ /**
* @return Attribute
*/
public function hydrate(array
$data) { $attribute =
new Attribute();
$translation =
$this->
getTranslation($data, null
);
$translation =
$this->
extractFields('___attribute_',
$translation);
unset($data['translation'
],
$data['translation_fallback'
]);
foreach ($data as $key =>
$value) { if (isset($translation[$key])) { $attribute->
set($key,
$translation[$key]);
} else { $attribute->
set($key,
$value);
} } return $attribute;
}