@@ 432-435 (lines=4) @@ | ||
429 | log_info('カテゴリCSV登録開始'); |
|
430 | ||
431 | $data = $this->getImportData($app, $formFile); |
|
432 | if ($data === false) { |
|
433 | $this->addErrors('CSVのフォーマットが一致しません。'); |
|
434 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
435 | } |
|
436 | ||
437 | $keys = array_keys($headers); |
|
438 | $columnHeaders = $data->getColumnHeaders(); |
|
@@ 473-476 (lines=4) @@ | ||
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が存在しません。'); |
|
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); |
|
@@ 499-502 (lines=4) @@ | ||
496 | } |
|
497 | ||
498 | $ParentCategory = $app['eccube.repository.category']->find($row['親カテゴリID']); |
|
499 | if (!$ParentCategory) { |
|
500 | $this->addErrors(($data->key() + 1) . '行目の親カテゴリIDが存在しません。'); |
|
501 | return $this->render($app, $form, $headers, $this->categoryTwig); |
|
502 | } |
|
503 | ||
504 | } else { |
|
505 | $ParentCategory = null; |