| @@ 179-195 (lines=17) @@ | ||
| 176 | * @param News $News |
|
| 177 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
| 178 | */ |
|
| 179 | public function up(Application $app, Request $request, News $News) |
|
| 180 | { |
|
| 181 | $this->isTokenValid($app); |
|
| 182 | ||
| 183 | try { |
|
| 184 | $this->newsRepository->up($News); |
|
| 185 | ||
| 186 | $app->addSuccess('admin.news.up.complete', 'admin'); |
|
| 187 | } catch (\Exception $e) { |
|
| 188 | ||
| 189 | log_error('新着情報表示順更新エラー', [$News->getId(), $e]); |
|
| 190 | ||
| 191 | $app->addError('admin.news.up.error', 'admin'); |
|
| 192 | } |
|
| 193 | ||
| 194 | return $app->redirect($app->url('admin_content_news')); |
|
| 195 | } |
|
| 196 | ||
| 197 | /** |
|
| 198 | * 指定した新着情報の表示順を1つ下げる。 |
|
| @@ 208-224 (lines=17) @@ | ||
| 205 | * @param News $News |
|
| 206 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
| 207 | */ |
|
| 208 | public function down(Application $app, Request $request, News $News) |
|
| 209 | { |
|
| 210 | $this->isTokenValid($app); |
|
| 211 | ||
| 212 | try { |
|
| 213 | $this->newsRepository->down($News); |
|
| 214 | ||
| 215 | $app->addSuccess('admin.news.down.complete', 'admin'); |
|
| 216 | } catch (\Exception $e) { |
|
| 217 | ||
| 218 | log_error('新着情報表示順更新エラー', [$News->getId(), $e]); |
|
| 219 | ||
| 220 | $app->addError('admin.news.down.error', 'admin'); |
|
| 221 | } |
|
| 222 | ||
| 223 | return $app->redirect($app->url('admin_content_news')); |
|
| 224 | } |
|
| 225 | ||
| 226 | /** |
|
| 227 | * 指定した新着情報を削除する。 |
|
| @@ 251-267 (lines=17) @@ | ||
| 248 | * @Method("PUT") |
|
| 249 | * @Route("/{_admin}/setting/system/member/{id}/up", requirements={"id" = "\d+"}, name="admin_setting_system_member_up") |
|
| 250 | */ |
|
| 251 | public function up(Application $app, Request $request, Member $Member) |
|
| 252 | { |
|
| 253 | $this->isTokenValid($app); |
|
| 254 | ||
| 255 | try { |
|
| 256 | $this->memberRepository->up($Member); |
|
| 257 | ||
| 258 | $app->addSuccess('admin.member.up.complete', 'admin'); |
|
| 259 | ||
| 260 | } catch (\Exception $e) { |
|
| 261 | log_error('メンバー表示順更新エラー', [$Member->getId(), $e]); |
|
| 262 | ||
| 263 | $app->addError('admin.member.up.error', 'admin'); |
|
| 264 | } |
|
| 265 | ||
| 266 | return $app->redirect($app->url('admin_setting_system_member')); |
|
| 267 | } |
|
| 268 | ||
| 269 | /** |
|
| 270 | * @Method("PUT") |
|
| @@ 273-288 (lines=16) @@ | ||
| 270 | * @Method("PUT") |
|
| 271 | * @Route("/{_admin}/setting/system/member/{id}/down", requirements={"id" = "\d+"}, name="admin_setting_system_member_down") |
|
| 272 | */ |
|
| 273 | public function down(Application $app, Request $request, Member $Member) |
|
| 274 | { |
|
| 275 | $this->isTokenValid($app); |
|
| 276 | ||
| 277 | try { |
|
| 278 | $this->memberRepository->down($Member); |
|
| 279 | ||
| 280 | $app->addSuccess('admin.member.down.complete', 'admin'); |
|
| 281 | } catch (\Exception $e) { |
|
| 282 | log_error('メンバー表示順更新エラー', [$Member->getId(), $e]); |
|
| 283 | ||
| 284 | $app->addError('admin.member.down.error', 'admin'); |
|
| 285 | } |
|
| 286 | ||
| 287 | return $app->redirect($app->url('admin_setting_system_member')); |
|
| 288 | } |
|
| 289 | ||
| 290 | /** |
|
| 291 | * @Method("DELETE") |
|