@@ -30,7 +30,6 @@ |
||
| 30 | 30 | use Eccube\Application; |
| 31 | 31 | use Eccube\Entity\Plugin; |
| 32 | 32 | use Eccube\Exception\PluginException; |
| 33 | -use Eccube\Plugin\ConfigManager; |
|
| 34 | 33 | use Eccube\Plugin\ConfigManager as PluginConfigManager; |
| 35 | 34 | use Eccube\Repository\PluginEventHandlerRepository; |
| 36 | 35 | use Eccube\Repository\PluginRepository; |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $class2Valied = $this->isValiedCategory($ClassName2); |
| 193 | 193 | |
| 194 | 194 | // 規格が選択されていないか、選択された状態で分類が保有されていれば、画面表示 |
| 195 | - if($class1Valied && $class2Valied){ |
|
| 195 | + if ($class1Valied && $class2Valied) { |
|
| 196 | 196 | $hasClassCategoryFlg = true; |
| 197 | 197 | } |
| 198 | 198 | |
@@ -269,7 +269,7 @@ discard block |
||
| 269 | 269 | $mergeProductClasses = array(); |
| 270 | 270 | |
| 271 | 271 | // 商品税率が設定されている場合、商品税率を項目に設定 |
| 272 | - if ($this->BaseInfo->getOptionProductTaxRule()) { |
|
| 272 | + if ($this->BaseInfo->getOptionProductTaxRule()) { |
|
| 273 | 273 | foreach ($ProductClasses as $class) { |
| 274 | 274 | if ($class->getTaxRule()) { |
| 275 | 275 | $class->setTaxRate($class->getTaxRule()->getTaxRate()); |
@@ -188,7 +188,7 @@ discard block |
||
| 188 | 188 | foreach ($data as $row) { |
| 189 | 189 | |
| 190 | 190 | if ($headerSize != count($row)) { |
| 191 | - $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。'); |
|
| 191 | + $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。'); |
|
| 192 | 192 | return $this->render($app, $form, $headers); |
| 193 | 193 | } |
| 194 | 194 | |
@@ -199,33 +199,33 @@ discard block |
||
| 199 | 199 | if (preg_match('/^\d+$/', $row['商品ID'])) { |
| 200 | 200 | $Product = $this->productRepository->find($row['商品ID']); |
| 201 | 201 | if (!$Product) { |
| 202 | - $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。'); |
|
| 202 | + $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。'); |
|
| 203 | 203 | return $this->render($app, $form, $headers); |
| 204 | 204 | } |
| 205 | 205 | } else { |
| 206 | - $this->addErrors(($data->key() + 1) . '行目の商品IDが存在しません。'); |
|
| 206 | + $this->addErrors(($data->key() + 1).'行目の商品IDが存在しません。'); |
|
| 207 | 207 | return $this->render($app, $form, $headers); |
| 208 | 208 | } |
| 209 | 209 | |
| 210 | 210 | } |
| 211 | 211 | |
| 212 | 212 | if ($row['公開ステータス(ID)'] == '') { |
| 213 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が設定されていません。'); |
|
| 213 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が設定されていません。'); |
|
| 214 | 214 | } else { |
| 215 | 215 | if (preg_match('/^\d+$/', $row['公開ステータス(ID)'])) { |
| 216 | 216 | $ProductStatus = $this->productStatusRepository->find($row['公開ステータス(ID)']); |
| 217 | 217 | if (!$ProductStatus) { |
| 218 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。'); |
|
| 218 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。'); |
|
| 219 | 219 | } else { |
| 220 | 220 | $Product->setStatus($ProductStatus); |
| 221 | 221 | } |
| 222 | 222 | } else { |
| 223 | - $this->addErrors(($data->key() + 1) . '行目の公開ステータス(ID)が存在しません。'); |
|
| 223 | + $this->addErrors(($data->key() + 1).'行目の公開ステータス(ID)が存在しません。'); |
|
| 224 | 224 | } |
| 225 | 225 | } |
| 226 | 226 | |
| 227 | 227 | if (Str::isBlank($row['商品名'])) { |
| 228 | - $this->addErrors(($data->key() + 1) . '行目の商品名が設定されていません。'); |
|
| 228 | + $this->addErrors(($data->key() + 1).'行目の商品名が設定されていません。'); |
|
| 229 | 229 | return $this->render($app, $form, $headers); |
| 230 | 230 | } else { |
| 231 | 231 | $Product->setName(Str::trimAll($row['商品名'])); |
@@ -284,7 +284,7 @@ discard block |
||
| 284 | 284 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
| 285 | 285 | $ProductClassOrg->setDeliveryFee($deliveryFee); |
| 286 | 286 | } else { |
| 287 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
| 287 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
| 288 | 288 | } |
| 289 | 289 | } |
| 290 | 290 | } |
@@ -292,7 +292,7 @@ discard block |
||
| 292 | 292 | if ($row['規格分類1(ID)'] != '') { |
| 293 | 293 | |
| 294 | 294 | if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) { |
| 295 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
| 295 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
| 296 | 296 | } else { |
| 297 | 297 | // 商品規格あり |
| 298 | 298 | // 企画分類あり商品を作成 |
@@ -307,30 +307,30 @@ discard block |
||
| 307 | 307 | if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) { |
| 308 | 308 | $ClassCategory1 = $this->classCategoryRepository->find($row['規格分類1(ID)']); |
| 309 | 309 | if (!$ClassCategory1) { |
| 310 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 310 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 311 | 311 | } else { |
| 312 | 312 | $ProductClass->setClassCategory1($ClassCategory1); |
| 313 | 313 | } |
| 314 | 314 | } else { |
| 315 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 315 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 316 | 316 | } |
| 317 | 317 | |
| 318 | 318 | if ($row['規格分類2(ID)'] != '') { |
| 319 | 319 | if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) { |
| 320 | 320 | $ClassCategory2 = $this->classCategoryRepository->find($row['規格分類2(ID)']); |
| 321 | 321 | if (!$ClassCategory2) { |
| 322 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 322 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 323 | 323 | } else { |
| 324 | 324 | if ($ClassCategory1 && |
| 325 | 325 | ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId()) |
| 326 | 326 | ) { |
| 327 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
| 327 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
| 328 | 328 | } else { |
| 329 | 329 | $ProductClass->setClassCategory2($ClassCategory2); |
| 330 | 330 | } |
| 331 | 331 | } |
| 332 | 332 | } else { |
| 333 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 333 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | $ProductClass->setProductStock($ProductStock); |
@@ -342,7 +342,7 @@ discard block |
||
| 342 | 342 | |
| 343 | 343 | } else { |
| 344 | 344 | if ($row['規格分類2(ID)'] != '') { |
| 345 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 345 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
@@ -370,7 +370,7 @@ discard block |
||
| 370 | 370 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
| 371 | 371 | $pc->setDeliveryFee($deliveryFee); |
| 372 | 372 | } else { |
| 373 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
| 373 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
| 374 | 374 | } |
| 375 | 375 | } |
| 376 | 376 | } |
@@ -392,7 +392,7 @@ discard block |
||
| 392 | 392 | } |
| 393 | 393 | |
| 394 | 394 | if ($row['規格分類1(ID)'] == $row['規格分類2(ID)']) { |
| 395 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
| 395 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)には同じ値を使用できません。'); |
|
| 396 | 396 | } else { |
| 397 | 397 | |
| 398 | 398 | // 必ず規格分類1がセットされている |
@@ -401,36 +401,36 @@ discard block |
||
| 401 | 401 | if (preg_match('/^\d+$/', $classCategoryId1)) { |
| 402 | 402 | $ClassCategory1 = $this->classCategoryRepository->find($classCategoryId1); |
| 403 | 403 | if (!$ClassCategory1) { |
| 404 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 404 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 405 | 405 | } |
| 406 | 406 | } else { |
| 407 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 407 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 408 | 408 | } |
| 409 | 409 | |
| 410 | 410 | $ClassCategory2 = null; |
| 411 | 411 | if ($row['規格分類2(ID)'] != '') { |
| 412 | 412 | if ($pc->getClassCategory1() != null && $pc->getClassCategory2() == null) { |
| 413 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)は設定できません。'); |
|
| 413 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)は設定できません。'); |
|
| 414 | 414 | } else { |
| 415 | 415 | if (preg_match('/^\d+$/', $classCategoryId2)) { |
| 416 | 416 | $ClassCategory2 = $this->classCategoryRepository->find($classCategoryId2); |
| 417 | 417 | if (!$ClassCategory2) { |
| 418 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 418 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 419 | 419 | } else { |
| 420 | 420 | if ($ClassCategory1 && |
| 421 | 421 | ($ClassCategory1->getClassName()->getId() == $ClassCategory2->getClassName()->getId()) |
| 422 | 422 | ) { |
| 423 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
| 423 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)と規格分類2(ID)の規格名が同じです。'); |
|
| 424 | 424 | } |
| 425 | 425 | } |
| 426 | 426 | } else { |
| 427 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 427 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 428 | 428 | } |
| 429 | 429 | |
| 430 | 430 | } |
| 431 | 431 | } else { |
| 432 | 432 | if ($pc->getClassCategory1() != null && $pc->getClassCategory2() != null) { |
| 433 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)に値を設定してください。'); |
|
| 433 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)に値を設定してください。'); |
|
| 434 | 434 | } |
| 435 | 435 | } |
| 436 | 436 | $ProductClass = $this->createProductClass($row, $Product, $app, $data, $ClassCategory1, $ClassCategory2); |
@@ -441,7 +441,7 @@ discard block |
||
| 441 | 441 | if (preg_match('/^\d+$/', $deliveryFee) && $deliveryFee >= 0) { |
| 442 | 442 | $ProductClass->setDeliveryFee($deliveryFee); |
| 443 | 443 | } else { |
| 444 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
| 444 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
| 445 | 445 | } |
| 446 | 446 | } |
| 447 | 447 | } |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | foreach ($data as $row) { |
| 532 | 532 | |
| 533 | 533 | if ($headerSize != count($row)) { |
| 534 | - $this->addErrors(($data->key() + 1) . '行目のCSVフォーマットが一致しません。'); |
|
| 534 | + $this->addErrors(($data->key() + 1).'行目のCSVフォーマットが一致しません。'); |
|
| 535 | 535 | return $this->render($app, $form, $headers); |
| 536 | 536 | } |
| 537 | 537 | |
@@ -539,23 +539,23 @@ discard block |
||
| 539 | 539 | $Category = new Category(); |
| 540 | 540 | } else { |
| 541 | 541 | if (!preg_match('/^\d+$/', $row['カテゴリID'])) { |
| 542 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
| 542 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。'); |
|
| 543 | 543 | return $this->render($app, $form, $headers); |
| 544 | 544 | } |
| 545 | 545 | $Category = $this->categoryRepository->find($row['カテゴリID']); |
| 546 | 546 | if (!$Category) { |
| 547 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
| 547 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDが存在しません。'); |
|
| 548 | 548 | return $this->render($app, $form, $headers); |
| 549 | 549 | } |
| 550 | 550 | if ($row['カテゴリID'] == $row['親カテゴリID']) { |
| 551 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。'); |
|
| 551 | + $this->addErrors(($data->key() + 1).'行目のカテゴリIDと親カテゴリIDが同じです。'); |
|
| 552 | 552 | return $this->render($app, $form, $headers); |
| 553 | 553 | } |
| 554 | 554 | |
| 555 | 555 | } |
| 556 | 556 | |
| 557 | 557 | if (Str::isBlank($row['カテゴリ名'])) { |
| 558 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリ名が設定されていません。'); |
|
| 558 | + $this->addErrors(($data->key() + 1).'行目のカテゴリ名が設定されていません。'); |
|
| 559 | 559 | return $this->render($app, $form, $headers); |
| 560 | 560 | } else { |
| 561 | 561 | $Category->setName(Str::trimAll($row['カテゴリ名'])); |
@@ -564,13 +564,13 @@ discard block |
||
| 564 | 564 | if ($row['親カテゴリID'] != '') { |
| 565 | 565 | |
| 566 | 566 | if (!preg_match('/^\d+$/', $row['親カテゴリID'])) { |
| 567 | - $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
| 567 | + $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。'); |
|
| 568 | 568 | return $this->render($app, $form, $headers); |
| 569 | 569 | } |
| 570 | 570 | |
| 571 | 571 | $ParentCategory = $this->categoryRepository->find($row['親カテゴリID']); |
| 572 | 572 | if (!$ParentCategory) { |
| 573 | - $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
| 573 | + $this->addErrors(($data->key() + 1).'行目の親カテゴリIDが存在しません。'); |
|
| 574 | 574 | return $this->render($app, $form, $headers); |
| 575 | 575 | } |
| 576 | 576 | |
@@ -586,7 +586,7 @@ discard block |
||
| 586 | 586 | } |
| 587 | 587 | |
| 588 | 588 | if ($this->appConfig['category_nest_level'] < $Category->getHierarchy()) { |
| 589 | - $this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。'); |
|
| 589 | + $this->addErrors(($data->key() + 1).'行目のカテゴリが最大レベルを超えているため設定できません。'); |
|
| 590 | 590 | return $this->render($app, $form, $headers); |
| 591 | 591 | } |
| 592 | 592 | |
@@ -636,7 +636,7 @@ discard block |
||
| 636 | 636 | throw new NotFoundHttpException(); |
| 637 | 637 | } |
| 638 | 638 | |
| 639 | - $response->setCallback(function () use ($app, $request, $headers) { |
|
| 639 | + $response->setCallback(function() use ($app, $request, $headers) { |
|
| 640 | 640 | |
| 641 | 641 | // ヘッダ行の出力 |
| 642 | 642 | $row = array(); |
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | }); |
| 652 | 652 | |
| 653 | 653 | $response->headers->set('Content-Type', 'application/octet-stream'); |
| 654 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
| 654 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
| 655 | 655 | $response->send(); |
| 656 | 656 | |
| 657 | 657 | return $response; |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | if (!empty($this->fileName)) { |
| 675 | 675 | try { |
| 676 | 676 | $fs = new Filesystem(); |
| 677 | - $fs->remove($this->appConfig['csv_temp_realdir'] . '/' . $this->fileName); |
|
| 677 | + $fs->remove($this->appConfig['csv_temp_realdir'].'/'.$this->fileName); |
|
| 678 | 678 | } catch (\Exception $e) { |
| 679 | 679 | // エラーが発生しても無視する |
| 680 | 680 | } |
@@ -697,10 +697,10 @@ discard block |
||
| 697 | 697 | protected function getImportData($app, $formFile) |
| 698 | 698 | { |
| 699 | 699 | // アップロードされたCSVファイルを一時ディレクトリに保存 |
| 700 | - $this->fileName = 'upload_' . Str::random() . '.' . $formFile->getClientOriginalExtension(); |
|
| 700 | + $this->fileName = 'upload_'.Str::random().'.'.$formFile->getClientOriginalExtension(); |
|
| 701 | 701 | $formFile->move($this->appConfig['csv_temp_realdir'], $this->fileName); |
| 702 | 702 | |
| 703 | - $file = file_get_contents($this->appConfig['csv_temp_realdir'] . '/' . $this->fileName); |
|
| 703 | + $file = file_get_contents($this->appConfig['csv_temp_realdir'].'/'.$this->fileName); |
|
| 704 | 704 | |
| 705 | 705 | if ('\\' === DIRECTORY_SEPARATOR && PHP_VERSION_ID >= 70000) { |
| 706 | 706 | // Windows 環境の PHP7 の場合はファイルエンコーディングを CP932 に合わせる |
@@ -796,8 +796,8 @@ discard block |
||
| 796 | 796 | if (!$Category) { |
| 797 | 797 | $this->addErrors(($data->key() + 1).'行目の商品カテゴリ(ID)「'.$category.'」が存在しません。'); |
| 798 | 798 | } else { |
| 799 | - foreach($Category->getPath() as $ParentCategory){ |
|
| 800 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
| 799 | + foreach ($Category->getPath() as $ParentCategory) { |
|
| 800 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
| 801 | 801 | $ProductCategory = $this->makeProductCategory($Product, $ParentCategory, $rank); |
| 802 | 802 | $this->entityManager->persist($ProductCategory); |
| 803 | 803 | $rank++; |
@@ -805,7 +805,7 @@ discard block |
||
| 805 | 805 | $categoriesIdList[$ParentCategory->getId()] = true; |
| 806 | 806 | } |
| 807 | 807 | } |
| 808 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
| 808 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
| 809 | 809 | $ProductCategory = $this->makeProductCategory($Product, $Category, $rank); |
| 810 | 810 | $rank++; |
| 811 | 811 | $this->em->persist($ProductCategory); |
@@ -860,7 +860,7 @@ discard block |
||
| 860 | 860 | } |
| 861 | 861 | } |
| 862 | 862 | if (!$Tag) { |
| 863 | - $this->addErrors(($data->key() + 1) . '行目のタグ(ID)「' . $tag_id . '」が存在しません。'); |
|
| 863 | + $this->addErrors(($data->key() + 1).'行目のタグ(ID)「'.$tag_id.'」が存在しません。'); |
|
| 864 | 864 | } |
| 865 | 865 | } |
| 866 | 866 | } |
@@ -879,17 +879,17 @@ discard block |
||
| 879 | 879 | |
| 880 | 880 | |
| 881 | 881 | if ($row['商品種別(ID)'] == '') { |
| 882 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。'); |
|
| 882 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。'); |
|
| 883 | 883 | } else { |
| 884 | 884 | if (preg_match('/^\d+$/', $row['商品種別(ID)'])) { |
| 885 | 885 | $ProductType = $this->productTypeRepository->find($row['商品種別(ID)']); |
| 886 | 886 | if (!$ProductType) { |
| 887 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
| 887 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
| 888 | 888 | } else { |
| 889 | 889 | $ProductClass->setProductType($ProductType); |
| 890 | 890 | } |
| 891 | 891 | } else { |
| 892 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
| 892 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
| 893 | 893 | } |
| 894 | 894 | } |
| 895 | 895 | |
@@ -900,12 +900,12 @@ discard block |
||
| 900 | 900 | if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) { |
| 901 | 901 | $DeliveryDate = $this->deliveryDateRepository->find($row['発送日目安(ID)']); |
| 902 | 902 | if (!$DeliveryDate) { |
| 903 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
| 903 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
| 904 | 904 | } else { |
| 905 | 905 | $ProductClass->setDeliveryDate($DeliveryDate); |
| 906 | 906 | } |
| 907 | 907 | } else { |
| 908 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
| 908 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
| 909 | 909 | } |
| 910 | 910 | } |
| 911 | 911 | |
@@ -916,19 +916,19 @@ discard block |
||
| 916 | 916 | } |
| 917 | 917 | |
| 918 | 918 | if ($row['在庫数無制限フラグ'] == '') { |
| 919 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
| 919 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
| 920 | 920 | } else { |
| 921 | 921 | if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) { |
| 922 | 922 | $ProductClass->setStockUnlimited(false); |
| 923 | 923 | // 在庫数が設定されていなければエラー |
| 924 | 924 | if ($row['在庫数'] == '') { |
| 925 | - $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。'); |
|
| 925 | + $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。'); |
|
| 926 | 926 | } else { |
| 927 | 927 | $stock = str_replace(',', '', $row['在庫数']); |
| 928 | 928 | if (preg_match('/^\d+$/', $stock) && $stock >= 0) { |
| 929 | 929 | $ProductClass->setStock($stock); |
| 930 | 930 | } else { |
| 931 | - $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。'); |
|
| 931 | + $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。'); |
|
| 932 | 932 | } |
| 933 | 933 | } |
| 934 | 934 | |
@@ -936,7 +936,7 @@ discard block |
||
| 936 | 936 | $ProductClass->setStockUnlimited(true); |
| 937 | 937 | $ProductClass->setStock(null); |
| 938 | 938 | } else { |
| 939 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
| 939 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
| 940 | 940 | } |
| 941 | 941 | } |
| 942 | 942 | |
@@ -945,7 +945,7 @@ discard block |
||
| 945 | 945 | if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) { |
| 946 | 946 | $ProductClass->setSaleLimit($saleLimit); |
| 947 | 947 | } else { |
| 948 | - $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。'); |
|
| 948 | + $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。'); |
|
| 949 | 949 | } |
| 950 | 950 | } |
| 951 | 951 | |
@@ -954,18 +954,18 @@ discard block |
||
| 954 | 954 | if (preg_match('/^\d+$/', $price01) && $price01 >= 0) { |
| 955 | 955 | $ProductClass->setPrice01($price01); |
| 956 | 956 | } else { |
| 957 | - $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。'); |
|
| 957 | + $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。'); |
|
| 958 | 958 | } |
| 959 | 959 | } |
| 960 | 960 | |
| 961 | 961 | if ($row['販売価格'] == '') { |
| 962 | - $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。'); |
|
| 962 | + $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。'); |
|
| 963 | 963 | } else { |
| 964 | 964 | $price02 = str_replace(',', '', $row['販売価格']); |
| 965 | 965 | if (preg_match('/^\d+$/', $price02) && $price02 >= 0) { |
| 966 | 966 | $ProductClass->setPrice02($price02); |
| 967 | 967 | } else { |
| 968 | - $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。'); |
|
| 968 | + $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。'); |
|
| 969 | 969 | } |
| 970 | 970 | } |
| 971 | 971 | |
@@ -974,7 +974,7 @@ discard block |
||
| 974 | 974 | if (preg_match('/^\d+$/', $delivery_fee) && $delivery_fee >= 0) { |
| 975 | 975 | $ProductClass->setDeliveryFee($delivery_fee); |
| 976 | 976 | } else { |
| 977 | - $this->addErrors(($data->key() + 1) . '行目の送料は0以上の数値を設定してください。'); |
|
| 977 | + $this->addErrors(($data->key() + 1).'行目の送料は0以上の数値を設定してください。'); |
|
| 978 | 978 | } |
| 979 | 979 | } |
| 980 | 980 | |
@@ -1007,17 +1007,17 @@ discard block |
||
| 1007 | 1007 | $ProductClass->setProduct($Product); |
| 1008 | 1008 | |
| 1009 | 1009 | if ($row['商品種別(ID)'] == '') { |
| 1010 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が設定されていません。'); |
|
| 1010 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が設定されていません。'); |
|
| 1011 | 1011 | } else { |
| 1012 | 1012 | if (preg_match('/^\d+$/', $row['商品種別(ID)'])) { |
| 1013 | 1013 | $ProductType = $this->productTypeRepository->find($row['商品種別(ID)']); |
| 1014 | 1014 | if (!$ProductType) { |
| 1015 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
| 1015 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
| 1016 | 1016 | } else { |
| 1017 | 1017 | $ProductClass->setProductType($ProductType); |
| 1018 | 1018 | } |
| 1019 | 1019 | } else { |
| 1020 | - $this->addErrors(($data->key() + 1) . '行目の商品種別(ID)が存在しません。'); |
|
| 1020 | + $this->addErrors(($data->key() + 1).'行目の商品種別(ID)が存在しません。'); |
|
| 1021 | 1021 | } |
| 1022 | 1022 | } |
| 1023 | 1023 | |
@@ -1026,12 +1026,12 @@ discard block |
||
| 1026 | 1026 | if (preg_match('/^\d+$/', $row['規格分類1(ID)'])) { |
| 1027 | 1027 | $ClassCategory = $this->classCategoryRepository->find($row['規格分類1(ID)']); |
| 1028 | 1028 | if (!$ClassCategory) { |
| 1029 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 1029 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 1030 | 1030 | } else { |
| 1031 | 1031 | $ProductClass->setClassCategory1($ClassCategory); |
| 1032 | 1032 | } |
| 1033 | 1033 | } else { |
| 1034 | - $this->addErrors(($data->key() + 1) . '行目の規格分類1(ID)が存在しません。'); |
|
| 1034 | + $this->addErrors(($data->key() + 1).'行目の規格分類1(ID)が存在しません。'); |
|
| 1035 | 1035 | } |
| 1036 | 1036 | } |
| 1037 | 1037 | |
@@ -1039,12 +1039,12 @@ discard block |
||
| 1039 | 1039 | if (preg_match('/^\d+$/', $row['規格分類2(ID)'])) { |
| 1040 | 1040 | $ClassCategory = $this->classCategoryRepository->find($row['規格分類2(ID)']); |
| 1041 | 1041 | if (!$ClassCategory) { |
| 1042 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 1042 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 1043 | 1043 | } else { |
| 1044 | 1044 | $ProductClass->setClassCategory2($ClassCategory); |
| 1045 | 1045 | } |
| 1046 | 1046 | } else { |
| 1047 | - $this->addErrors(($data->key() + 1) . '行目の規格分類2(ID)が存在しません。'); |
|
| 1047 | + $this->addErrors(($data->key() + 1).'行目の規格分類2(ID)が存在しません。'); |
|
| 1048 | 1048 | } |
| 1049 | 1049 | } |
| 1050 | 1050 | |
@@ -1052,12 +1052,12 @@ discard block |
||
| 1052 | 1052 | if (preg_match('/^\d+$/', $row['発送日目安(ID)'])) { |
| 1053 | 1053 | $DeliveryDate = $this->deliveryDateRepository->find($row['発送日目安(ID)']); |
| 1054 | 1054 | if (!$DeliveryDate) { |
| 1055 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
| 1055 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
| 1056 | 1056 | } else { |
| 1057 | 1057 | $ProductClass->setDeliveryDate($DeliveryDate); |
| 1058 | 1058 | } |
| 1059 | 1059 | } else { |
| 1060 | - $this->addErrors(($data->key() + 1) . '行目の発送日目安(ID)が存在しません。'); |
|
| 1060 | + $this->addErrors(($data->key() + 1).'行目の発送日目安(ID)が存在しません。'); |
|
| 1061 | 1061 | } |
| 1062 | 1062 | } |
| 1063 | 1063 | |
@@ -1068,19 +1068,19 @@ discard block |
||
| 1068 | 1068 | } |
| 1069 | 1069 | |
| 1070 | 1070 | if ($row['在庫数無制限フラグ'] == '') { |
| 1071 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
| 1071 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
| 1072 | 1072 | } else { |
| 1073 | 1073 | if ($row['在庫数無制限フラグ'] == (string) Constant::DISABLED) { |
| 1074 | 1074 | $ProductClass->setStockUnlimited(false); |
| 1075 | 1075 | // 在庫数が設定されていなければエラー |
| 1076 | 1076 | if ($row['在庫数'] == '') { |
| 1077 | - $this->addErrors(($data->key() + 1) . '行目の在庫数が設定されていません。'); |
|
| 1077 | + $this->addErrors(($data->key() + 1).'行目の在庫数が設定されていません。'); |
|
| 1078 | 1078 | } else { |
| 1079 | 1079 | $stock = str_replace(',', '', $row['在庫数']); |
| 1080 | 1080 | if (preg_match('/^\d+$/', $stock) && $stock >= 0) { |
| 1081 | 1081 | $ProductClass->setStock($row['在庫数']); |
| 1082 | 1082 | } else { |
| 1083 | - $this->addErrors(($data->key() + 1) . '行目の在庫数は0以上の数値を設定してください。'); |
|
| 1083 | + $this->addErrors(($data->key() + 1).'行目の在庫数は0以上の数値を設定してください。'); |
|
| 1084 | 1084 | } |
| 1085 | 1085 | } |
| 1086 | 1086 | |
@@ -1088,7 +1088,7 @@ discard block |
||
| 1088 | 1088 | $ProductClass->setStockUnlimited(true); |
| 1089 | 1089 | $ProductClass->setStock(null); |
| 1090 | 1090 | } else { |
| 1091 | - $this->addErrors(($data->key() + 1) . '行目の在庫数無制限フラグが設定されていません。'); |
|
| 1091 | + $this->addErrors(($data->key() + 1).'行目の在庫数無制限フラグが設定されていません。'); |
|
| 1092 | 1092 | } |
| 1093 | 1093 | } |
| 1094 | 1094 | |
@@ -1097,7 +1097,7 @@ discard block |
||
| 1097 | 1097 | if (preg_match('/^\d+$/', $saleLimit) && $saleLimit >= 0) { |
| 1098 | 1098 | $ProductClass->setSaleLimit($saleLimit); |
| 1099 | 1099 | } else { |
| 1100 | - $this->addErrors(($data->key() + 1) . '行目の販売制限数は0以上の数値を設定してください。'); |
|
| 1100 | + $this->addErrors(($data->key() + 1).'行目の販売制限数は0以上の数値を設定してください。'); |
|
| 1101 | 1101 | } |
| 1102 | 1102 | } |
| 1103 | 1103 | |
@@ -1106,18 +1106,18 @@ discard block |
||
| 1106 | 1106 | if (preg_match('/^\d+$/', $price01) && $price01 >= 0) { |
| 1107 | 1107 | $ProductClass->setPrice01($price01); |
| 1108 | 1108 | } else { |
| 1109 | - $this->addErrors(($data->key() + 1) . '行目の通常価格は0以上の数値を設定してください。'); |
|
| 1109 | + $this->addErrors(($data->key() + 1).'行目の通常価格は0以上の数値を設定してください。'); |
|
| 1110 | 1110 | } |
| 1111 | 1111 | } |
| 1112 | 1112 | |
| 1113 | 1113 | if ($row['販売価格'] == '') { |
| 1114 | - $this->addErrors(($data->key() + 1) . '行目の販売価格が設定されていません。'); |
|
| 1114 | + $this->addErrors(($data->key() + 1).'行目の販売価格が設定されていません。'); |
|
| 1115 | 1115 | } else { |
| 1116 | 1116 | $price02 = str_replace(',', '', $row['販売価格']); |
| 1117 | 1117 | if (preg_match('/^\d+$/', $price02) && $price02 >= 0) { |
| 1118 | 1118 | $ProductClass->setPrice02($price02); |
| 1119 | 1119 | } else { |
| 1120 | - $this->addErrors(($data->key() + 1) . '行目の販売価格は0以上の数値を設定してください。'); |
|
| 1120 | + $this->addErrors(($data->key() + 1).'行目の販売価格は0以上の数値を設定してください。'); |
|
| 1121 | 1121 | } |
| 1122 | 1122 | } |
| 1123 | 1123 | |
@@ -318,7 +318,7 @@ discard block |
||
| 318 | 318 | } |
| 319 | 319 | |
| 320 | 320 | $extension = $image->getClientOriginalExtension(); |
| 321 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
| 321 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
| 322 | 322 | $image->move($this->appConfig['image_temp_realdir'], $filename); |
| 323 | 323 | $files[] = $filename; |
| 324 | 324 | } |
@@ -479,8 +479,8 @@ discard block |
||
| 479 | 479 | $Categories = $form->get('Category')->getData(); |
| 480 | 480 | $categoriesIdList = array(); |
| 481 | 481 | foreach ($Categories as $Category) { |
| 482 | - foreach($Category->getPath() as $ParentCategory){ |
|
| 483 | - if (!isset($categoriesIdList[$ParentCategory->getId()])){ |
|
| 482 | + foreach ($Category->getPath() as $ParentCategory) { |
|
| 483 | + if (!isset($categoriesIdList[$ParentCategory->getId()])) { |
|
| 484 | 484 | $ProductCategory = $this->createProductCategory($Product, $ParentCategory, $count); |
| 485 | 485 | $this->entityManager->persist($ProductCategory); |
| 486 | 486 | $count++; |
@@ -489,7 +489,7 @@ discard block |
||
| 489 | 489 | $categoriesIdList[$ParentCategory->getId()] = true; |
| 490 | 490 | } |
| 491 | 491 | } |
| 492 | - if (!isset($categoriesIdList[$Category->getId()])){ |
|
| 492 | + if (!isset($categoriesIdList[$Category->getId()])) { |
|
| 493 | 493 | $ProductCategory = $this->createProductCategory($Product, $Category, $count); |
| 494 | 494 | $this->entityManager->persist($ProductCategory); |
| 495 | 495 | $count++; |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | $this->entityManager->persist($ProductImage); |
| 512 | 512 | |
| 513 | 513 | // 移動 |
| 514 | - $file = new File($this->appConfig['image_temp_realdir'] . '/' . $add_image); |
|
| 514 | + $file = new File($this->appConfig['image_temp_realdir'].'/'.$add_image); |
|
| 515 | 515 | $file->move($this->appConfig['image_save_realdir']); |
| 516 | 516 | } |
| 517 | 517 | |
@@ -531,7 +531,7 @@ discard block |
||
| 531 | 531 | |
| 532 | 532 | // 削除 |
| 533 | 533 | $fs = new Filesystem(); |
| 534 | - $fs->remove($this->appConfig['image_save_realdir'] . '/' . $delete_image); |
|
| 534 | + $fs->remove($this->appConfig['image_save_realdir'].'/'.$delete_image); |
|
| 535 | 535 | } |
| 536 | 536 | $this->entityManager->persist($Product); |
| 537 | 537 | $this->entityManager->flush(); |
@@ -666,7 +666,7 @@ discard block |
||
| 666 | 666 | foreach ($deleteImages as $deleteImage) { |
| 667 | 667 | try { |
| 668 | 668 | $fs = new Filesystem(); |
| 669 | - $fs->remove($this->appConfig['image_save_realdir'] . '/' . $deleteImage); |
|
| 669 | + $fs->remove($this->appConfig['image_save_realdir'].'/'.$deleteImage); |
|
| 670 | 670 | } catch (\Exception $e) { |
| 671 | 671 | // エラーが発生しても無視する |
| 672 | 672 | } |
@@ -741,10 +741,10 @@ discard block |
||
| 741 | 741 | |
| 742 | 742 | // 画像ファイルを新規作成 |
| 743 | 743 | $extension = pathinfo($Image->getFileName(), PATHINFO_EXTENSION); |
| 744 | - $filename = date('mdHis') . uniqid('_') . '.' . $extension; |
|
| 744 | + $filename = date('mdHis').uniqid('_').'.'.$extension; |
|
| 745 | 745 | try { |
| 746 | 746 | $fs = new Filesystem(); |
| 747 | - $fs->copy($this->appConfig['image_save_realdir'] . '/' . $Image->getFileName(), $this->appConfig['image_save_realdir'] . '/' . $filename); |
|
| 747 | + $fs->copy($this->appConfig['image_save_realdir'].'/'.$Image->getFileName(), $this->appConfig['image_save_realdir'].'/'.$filename); |
|
| 748 | 748 | } catch (\Exception $e) { |
| 749 | 749 | // エラーが発生しても無視する |
| 750 | 750 | } |
@@ -824,7 +824,7 @@ discard block |
||
| 824 | 824 | $em->getConfiguration()->setSQLLogger(null); |
| 825 | 825 | |
| 826 | 826 | $response = new StreamedResponse(); |
| 827 | - $response->setCallback(function () use ($app, $request) { |
|
| 827 | + $response->setCallback(function() use ($app, $request) { |
|
| 828 | 828 | |
| 829 | 829 | // CSV種別を元に初期化. |
| 830 | 830 | $this->csvExportService->initCsvType(CsvType::CSV_TYPE_PRODUCT); |
@@ -864,7 +864,7 @@ discard block |
||
| 864 | 864 | // データ行の出力. |
| 865 | 865 | $this->csvExportService->setExportQueryBuilder($qb); |
| 866 | 866 | |
| 867 | - $this->csvExportService->exportData(function ($entity, CsvExportService $csvService) use ($app, $request) { |
|
| 867 | + $this->csvExportService->exportData(function($entity, CsvExportService $csvService) use ($app, $request) { |
|
| 868 | 868 | $Csvs = $csvService->getCsvs(); |
| 869 | 869 | |
| 870 | 870 | /** @var $Product \Eccube\Entity\Product */ |
@@ -907,9 +907,9 @@ discard block |
||
| 907 | 907 | }); |
| 908 | 908 | |
| 909 | 909 | $now = new \DateTime(); |
| 910 | - $filename = 'product_' . $now->format('YmdHis') . '.csv'; |
|
| 910 | + $filename = 'product_'.$now->format('YmdHis').'.csv'; |
|
| 911 | 911 | $response->headers->set('Content-Type', 'application/octet-stream'); |
| 912 | - $response->headers->set('Content-Disposition', 'attachment; filename=' . $filename); |
|
| 912 | + $response->headers->set('Content-Disposition', 'attachment; filename='.$filename); |
|
| 913 | 913 | $response->send(); |
| 914 | 914 | |
| 915 | 915 | log_info('商品CSV出力ファイル名', array($filename)); |