diff --git a/common/modules/language/behaviors/LanguageBehavior.php b/common/modules/language/behaviors/LanguageBehavior.php index ec955c0..9b3ef25 100755 --- a/common/modules/language/behaviors/LanguageBehavior.php +++ b/common/modules/language/behaviors/LanguageBehavior.php @@ -237,7 +237,7 @@ $success = true; $model_langs = $this->model_langs; foreach($model_langs as $model_lang) { - if($model_lang->save() === false) { + if($model_lang->save(false) === false) { $success = false; } } diff --git a/common/modules/product/models/Import.php b/common/modules/product/models/Import.php index 0f13b59..e8a757b 100755 --- a/common/modules/product/models/Import.php +++ b/common/modules/product/models/Import.php @@ -128,7 +128,7 @@ // Create stock $stock = new Stock(); $stock->name = trim($city_name); - $stock->save(); + $stock->save(false); } $productStock = ProductStock::find() @@ -145,7 +145,7 @@ } $productStock->quantity = $count; - $productStock->save(); + $productStock->save(false); $productStocks = ProductStock::find() ->where([ 'product_variant_id' => $productVariant->product_variant_id ]) ->andWhere([ @@ -180,7 +180,7 @@ $productVariant->stock = $quantity; - $productVariant->save(); + $productVariant->save(false); $this->output[] = 'Товар ' . $product_title . ' успешно сохранен'; } @@ -244,7 +244,7 @@ ) { if(!empty( $category->lang )) { $category->lang->name = $parsed_name[ 'name' ]; - $category->lang->save(); + $category->lang->save(false); } else { throw new \Exception('Category with ID ' . $category->category_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -258,7 +258,7 @@ $category_lang->name = $parsed_name[ 'name' ]; } $category->remote_id = $parsed_name[ 'remote_id' ]; - $category->save(); + $category->save(false); } $category_id[] = $category->category_id; } @@ -286,7 +286,7 @@ ) { if(!empty( $brand->lang )) { $brand->lang->name = $parsed_name[ 'name' ]; - $brand->lang->save(); + $brand->lang->save(false); } else { throw new \Exception('Brand with ID ' . $brand->brand_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -300,7 +300,7 @@ $brand_lang->name = $parsed_name[ 'name' ]; } $brand->remote_id = $parsed_name[ 'remote_id' ]; - $brand->save(); + $brand->save(false); return $brand->brand_id; } } @@ -329,7 +329,7 @@ $productImage->product_id = $product_id; $productImage->product_variant_id = $product_variant_id; $productImage->image = $foto; - $productImage->save(); + $productImage->save(false); } } } @@ -381,7 +381,7 @@ } else { if(!empty( $_productVariant->lang )) { $_productVariant->lang->name = $mod_name; - $_productVariant->lang->save(); + $_productVariant->lang->save(false); } else { throw new \Exception('Product variant with ID ' . $_productVariant->product_variant_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -539,7 +539,7 @@ if(!empty( $_product->lang )) { $_product->lang->name = $parsed_name[ 'name' ]; $_product->lang->description = $product_body; - $_product->lang->save(); + $_product->lang->save(false); } else { throw new \Exception('Product with ID ' . $_product->product_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -573,7 +573,7 @@ $product_name_inserted = $_product->model_langs[ Language::$current->language_id ]->name; } - if(($_product->save() === false) || !$_product->transactionStatus) { + if(($_product->save(false) === false) || !$_product->transactionStatus) { $result_items[] = 'Product #' . $product_name_inserted . ' not saved' . " (line $j)"; continue; } @@ -583,7 +583,7 @@ $this->saveVariants($data, $product_cost_old, $_product->product_id, $_product->categories, $product_cost); -// $_product->save(); +// $_product->save(false); $result_items[] = "Product {$product_name_inserted} #{$_product->product_id} saved (" . ( $is_new_product ? 'new product' : 'exists product' ) . ")" . " (line $j)"; @@ -652,7 +652,7 @@ ) { if(!empty( $taxGroup->lang )) { $taxGroup->lang->name = $parsed_group_name[ 'name' ]; - $taxGroup->lang->save(); + $taxGroup->lang->save(false); } else { throw new \Exception('Tax group with ID ' . $taxGroup->tax_group_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -666,7 +666,7 @@ $taxGroup->level = $level; $taxGroup->categories = $catalog_names; $taxGroup->is_filter = false; - $taxGroup->save(); + $taxGroup->save(false); } $filters_options = explode(',', $filter[ 2 ][ 0 ]); foreach($filters_options as $filter_options) { @@ -683,7 +683,7 @@ ) { if(!empty( $option->lang )) { $option->lang->value = $parsed_option_name[ 'name' ]; - $option->lang->save(); + $option->lang->save(false); } else { throw new \Exception('Tax option with ID ' . $option->tax_option_id . ' and lang ' . Language::getCurrent()->language_id . ' doesn\'t exist'); } @@ -696,7 +696,7 @@ $option_lang->value = $parsed_option_name[ 'name' ]; } $option->tax_group_id = $taxGroup->tax_group_id; - $option->save(); + $option->save(false); } $options[] = $option->tax_option_id; } -- libgit2 0.21.4