@@ 460-463 (lines=4) @@ | ||
457 | if ($row['カテゴリID'] == '') { |
|
458 | $Category = new Category(); |
|
459 | } else { |
|
460 | if (!is_numeric($row['カテゴリID'])) { |
|
461 | $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
462 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
463 | } |
|
464 | $Category = $app['eccube.repository.category']->find($row['カテゴリID']); |
|
465 | if (!$Category) { |
|
466 | $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
@@ 469-472 (lines=4) @@ | ||
466 | $this->addErrors(($data->key() + 1) . '行目のカテゴリIDが存在しません。'); |
|
467 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
468 | } |
|
469 | if ($row['カテゴリID'] == $row['親カテゴリID']) { |
|
470 | $this->addErrors(($data->key() + 1) . '行目のカテゴリIDと親カテゴリIDが同じです。'); |
|
471 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
472 | } |
|
473 | ||
474 | } |
|
475 | ||
@@ 485-488 (lines=4) @@ | ||
482 | ||
483 | if ($row['親カテゴリID'] != '') { |
|
484 | ||
485 | if (!is_numeric($row['親カテゴリID'])) { |
|
486 | $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
487 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
488 | } |
|
489 | ||
490 | $ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']); |
|
491 | if (!$ParentCategory) { |
|
@@ 507-510 (lines=4) @@ | ||
504 | $Category->setLevel(1); |
|
505 | } |
|
506 | ||
507 | if ($app['config']['category_nest_level'] < $Category->getLevel()) { |
|
508 | $this->addErrors(($data->key() + 1) . '行目のカテゴリが最大レベルを超えているため設定できません。'); |
|
509 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
510 | } |
|
511 | ||
512 | $status = $app['eccube.repository.category']->save($Category); |
|
513 |