|
@@ 468-471 (lines=4) @@
|
| 465 |
|
if ($row['カテゴリID'] == '') { |
| 466 |
|
$Category = new Category(); |
| 467 |
|
} else { |
| 468 |
|
if (!preg_match('/^\d+$/', $row['カテゴリID'])) { |
| 469 |
|
$this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
| 470 |
|
return $this->render($app, $form, $headers, $this->categoryTwig); |
| 471 |
|
} |
| 472 |
|
$Category = $app['eccube.repository.category']->find($row['カテゴリID']); |
| 473 |
|
if (!$Category) { |
| 474 |
|
$this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
@@ 477-480 (lines=4) @@
|
| 474 |
|
$this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
| 475 |
|
return $this->render($app, $form, $headers, $this->categoryTwig); |
| 476 |
|
} |
| 477 |
|
if ($row['カテゴリID'] == $row['親カテゴリID']) { |
| 478 |
|
$this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。'); |
| 479 |
|
return $this->render($app, $form, $headers, $this->categoryTwig); |
| 480 |
|
} |
| 481 |
|
|
| 482 |
|
} |
| 483 |
|
|
|
@@ 493-496 (lines=4) @@
|
| 490 |
|
|
| 491 |
|
if ($row['親カテゴリID'] != '') { |
| 492 |
|
|
| 493 |
|
if (!preg_match('/^\d+$/', $row['親カテゴリID'])) { |
| 494 |
|
$this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
| 495 |
|
return $this->render($app, $form, $headers, $this->categoryTwig); |
| 496 |
|
} |
| 497 |
|
|
| 498 |
|
$ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']); |
| 499 |
|
if (!$ParentCategory) { |
|
@@ 515-518 (lines=4) @@
|
| 512 |
|
$Category->setLevel(1); |
| 513 |
|
} |
| 514 |
|
|
| 515 |
|
if ($app['config']['category_nest_level'] < $Category->getLevel()) { |
| 516 |
|
$this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。'); |
| 517 |
|
return $this->render($app, $form, $headers, $this->categoryTwig); |
| 518 |
|
} |
| 519 |
|
|
| 520 |
|
$status = $app['eccube.repository.category']->save($Category); |
| 521 |
|
|