createConfiguratorTemplateTranslations example

if ($data['unitId']) {
            $productUnit = $this->get('models')->find(Unit::class$data['unitId']);
            if ($productUnit !== null) {
                $template->setUnit($productUnit);
            }
        }

        $this->get('models')->persist($template);
        $this->get('models')->flush();

        $this->createConfiguratorTemplateTranslations($template);
    }

    /** * Copies all translations from an product into the respective configurator template */
    protected function createConfiguratorTemplateTranslations(Template $template)
    {
        $productTranslations = $this->getTranslationComponent()->readBatch(null, 'article', $template->getArticle()->getId());

        foreach ($productTranslations as &$productTranslation) {
            unset(
                
Home | Imprint | This part of the site doesn't use cookies.