| @@ 73-92 (lines=20) @@ | ||
| 70 | )); |
|
| 71 | } |
|
| 72 | ||
| 73 | public function delete(Application $app, Request $request, $id) |
|
| 74 | { |
|
| 75 | $this->isTokenValid($app); |
|
| 76 | ||
| 77 | $TargetClassName = $app['eccube.repository.class_name']->find($id); |
|
| 78 | if (!$TargetClassName) { |
|
| 79 | $app->deleteMessage(); |
|
| 80 | return $app->redirect($app->url('admin_product_class_name')); |
|
| 81 | } |
|
| 82 | ||
| 83 | $status = $app['eccube.repository.class_name']->delete($TargetClassName); |
|
| 84 | ||
| 85 | if ($status === true) { |
|
| 86 | $app->addSuccess('admin.class_name.delete.complete', 'admin'); |
|
| 87 | } else { |
|
| 88 | $app->addError('admin.class_name.delete.error', 'admin'); |
|
| 89 | } |
|
| 90 | ||
| 91 | return $app->redirect($app->url('admin_product_class_name')); |
|
| 92 | } |
|
| 93 | ||
| 94 | public function moveRank(Application $app, Request $request) |
|
| 95 | { |
|
| @@ 155-174 (lines=20) @@ | ||
| 152 | return $app->redirect($app->url('admin_setting_system_member')); |
|
| 153 | } |
|
| 154 | ||
| 155 | public function delete(Application $app, Request $request, $id) |
|
| 156 | { |
|
| 157 | $this->isTokenValid($app); |
|
| 158 | ||
| 159 | $TargetMember = $app['eccube.repository.member']->find($id); |
|
| 160 | if (!$TargetMember) { |
|
| 161 | $app->deleteMessage(); |
|
| 162 | return $app->redirect($app->url('admin_setting_system_member')); |
|
| 163 | } |
|
| 164 | ||
| 165 | $status = $app['eccube.repository.member']->delete($TargetMember); |
|
| 166 | ||
| 167 | if ($status) { |
|
| 168 | $app->addSuccess('admin.member.delete.complete', 'admin'); |
|
| 169 | } else { |
|
| 170 | $app->addError('admin.member.delete.error', 'admin'); |
|
| 171 | } |
|
| 172 | ||
| 173 | return $app->redirect($app->url('admin_setting_system_member')); |
|
| 174 | } |
|
| 175 | } |
|