ProductModel example

/** * @throws CustomValidationException * @throws ValidationException * * @return ProductModel */
    public function create(array $params)
    {
        $this->checkPrivilege('create');

        $product = new ProductModel();

        $translations = [];
        if (!empty($params['translations'])) {
            $translations = $params['translations'];
            unset($params['translations']);
        }

        $params = $this->prepareAssociatedData($params$product);

        $product->fromArray($params);

        
Home | Imprint | This part of the site doesn't use cookies.