Manufacturer example

public function __construct(AttributeHydrator $attributeHydrator, MediaServiceInterface $mediaService)
    {
        $this->attributeHydrator = $attributeHydrator;
        $this->mediaService = $mediaService;
    }

    /** * @return Manufacturer */
    public function hydrate(array $data)
    {
        $manufacturer = new Manufacturer();
        $this->assignData($manufacturer$data);

        return $manufacturer;
    }

    private function assignData(Manufacturer $manufacturer, array $data)
    {
        $translation = $this->getTranslation($data, '__manufacturer', $this->mapping);
        $data = array_merge($data$translation);

        if (isset($data['__manufacturer_id'])) {
            
Home | Imprint | This part of the site doesn't use cookies.