saveDetail example

$data = $this->Request()->getParams();
        $id = (int) $this->Request()->getParam('id');

        if ($id > 0) {
            $detail = $this->getArticleDetailRepository()->find($id);
            if (!$detail instanceof ProductVariant) {
                throw new ModelNotFoundException(ProductVariant::class$id);
            }
        } else {
            $detail = new ProductVariant();
        }
        $detail = $this->saveDetail($data$detail);
        $data['id'] = $detail->getId();
        $this->View()->assign([
            'success' => true,
            'data' => $data,
        ]);
    }

    /** * Event listener function of the product backend module. Fired when the user saves or updates * an product configurator dependency in the dependency window. */
    
$template$name] = explode(':', $templateConfigRaw);
            $data[] = ['template' => $template, 'name' => $name];
        }
        $this->View()->assign(['success' => true, 'data' => $data, 'total' => \count($data)]);
    }

    /** * Wrapper around the save method to have better ACL control */
    public function updateDetailAction()
    {
        $this->saveDetail();
    }

    /** * Wrapper around the save method to have better ACL control */
    public function createDetailAction()
    {
        $this->saveDetail();
    }

    /** * returns a JSON string to the view the products for the product mapping */
Home | Imprint | This part of the site doesn't use cookies.