$additionalCharacteristic->value = $characteristic["value_name"];
if (!$additionalCharacteristic->save()) {
- LogService::apiErrorLog(json_encode(["error_id" => 8.2,
- "error" => $additionalCharacteristic->getErrors()],
- JSON_UNESCAPED_UNICODE));
+ LogService::apiErrorLog(
+ json_encode(
+ ["error_id" => 8.2, "error" => $additionalCharacteristic->getErrors()],
+ JSON_UNESCAPED_UNICODE
+ )
+ );
}
}
}
$paymentTypes->name = $arr['name'];
$paymentTypes->save();
if ($paymentTypes->getErrors()) {
- LogService::apiErrorLog(json_encode(["error_id" => 9, "error" => $paymentTypes->getErrors()], JSON_UNESCAPED_UNICODE));
+ LogService::apiErrorLog(json_encode(
+ ["error_id" => 9,
+ "error" => $paymentTypes->getErrors()],
+ JSON_UNESCAPED_UNICODE
+ ));
}
$products1c7 = Products1c::findOne(['id' => $arr["id"]]) ?? new Products1c();
$products1c7->code = $arr["code"];
$products1c7->save();
if ($products1c7->getErrors()) {
- LogService::apiErrorLog(json_encode(["error_id" => 10, "error" => $products1c7->getErrors()], JSON_UNESCAPED_UNICODE));
+ LogService::apiErrorLog(json_encode(
+ ["error_id" => 10, "error" => $products1c7->getErrors()],
+ JSON_UNESCAPED_UNICODE
+ ));
}
}
}
if (!empty($result['created_write_offs'])) {
$productsNames = Products1c::getNamesByTip('products');
- file_put_contents(self::OUT_DIR . '/created_write_offs_upload_' . date("Y_m_d") . '.json', PHP_EOL . json_encode($result["created_write_offs"],JSON_UNESCAPED_UNICODE), FILE_APPEND);
+ file_put_contents(
+ self::OUT_DIR . '/created_write_offs_upload_'
+ . date("Y_m_d") . '.json',
+ PHP_EOL
+ . json_encode($result["created_write_offs"],JSON_UNESCAPED_UNICODE),
+ FILE_APPEND
+ );
foreach ($result["created_write_offs"] as $arr) {
if (!empty($arr["id"])) {
$writeOffsErp = WriteOffsErp::find()->where(['guid' => $arr["id"]])->one();
$writeOffsErp->error_text = $errorText;
$writeOffsErp->save();
if ($writeOffsErp->getErrors()) {
- LogService::apiErrorLog(json_encode(["error_id" => 11, "error" => $writeOffsErp->getErrors()], JSON_UNESCAPED_UNICODE));
+ LogService::apiErrorLog(
+ json_encode(
+ ["error_id" => 11, "error" => $writeOffsErp->getErrors()],
+ JSON_UNESCAPED_UNICODE
+ )
+ );
}
} else {
/** @var WriteOffsErp $writeOffsErp */
$writeOffsErp->number_1c = $arr["number"] ?? '';
$writeOffsErp->save();
if ($writeOffsErp->getErrors()) {
- LogService::apiErrorLog(json_encode(["error_id" => 11, "error" => $writeOffsErp->getErrors()], JSON_UNESCAPED_UNICODE));
+ LogService::apiErrorLog(
+ json_encode(
+ ["error_id" => 11,
+ "error" => $writeOffsErp->getErrors()],
+ JSON_UNESCAPED_UNICODE
+ )
+ );
}
}
return [
[['product_id', 'property_id', 'value'], 'required'],
[['product_id', 'property_id', 'value'], 'string', 'max' => 255],
- [['property_id'], 'exist', 'skipOnError' => true, 'targetClass' => Products1cPropType::class, 'targetAttribute' => ['property_id' => 'id']],
+ [['property_id'], 'exist', 'skipOnError' => true, 'targetClass' => Products1cPropType::class,
+ 'targetAttribute' => ['property_id' => 'id']],
];
}