| @@ 147-162 (lines=16) @@ | ||
| 144 | * |
|
| 145 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
| 146 | */ |
|
| 147 | public function up(News $News) |
|
| 148 | { |
|
| 149 | $this->isTokenValid(); |
|
| 150 | ||
| 151 | try { |
|
| 152 | $this->newsRepository->up($News); |
|
| 153 | ||
| 154 | $this->addSuccess('admin.news.up.complete', 'admin'); |
|
| 155 | } catch (\Exception $e) { |
|
| 156 | log_error('新着情報表示順更新エラー', [$News->getId(), $e]); |
|
| 157 | ||
| 158 | $this->addError('admin.news.up.error', 'admin'); |
|
| 159 | } |
|
| 160 | ||
| 161 | return $this->redirectToRoute('admin_content_news'); |
|
| 162 | } |
|
| 163 | ||
| 164 | /** |
|
| 165 | * 指定した新着情報の表示順を1つ下げる。 |
|
| @@ 174-189 (lines=16) @@ | ||
| 171 | * |
|
| 172 | * @return \Symfony\Component\HttpFoundation\RedirectResponse |
|
| 173 | */ |
|
| 174 | public function down(News $News) |
|
| 175 | { |
|
| 176 | $this->isTokenValid(); |
|
| 177 | ||
| 178 | try { |
|
| 179 | $this->newsRepository->down($News); |
|
| 180 | ||
| 181 | $this->addSuccess('admin.news.down.complete', 'admin'); |
|
| 182 | } catch (\Exception $e) { |
|
| 183 | log_error('新着情報表示順更新エラー', [$News->getId(), $e]); |
|
| 184 | ||
| 185 | $this->addError('admin.news.down.error', 'admin'); |
|
| 186 | } |
|
| 187 | ||
| 188 | return $this->redirectToRoute('admin_content_news'); |
|
| 189 | } |
|
| 190 | ||
| 191 | /** |
|
| 192 | * 指定した新着情報を削除する。 |
|
| @@ 219-234 (lines=16) @@ | ||
| 216 | * @Method("PUT") |
|
| 217 | * @Route("/%eccube_admin_route%/setting/system/member/{id}/up", requirements={"id" = "\d+"}, name="admin_setting_system_member_up") |
|
| 218 | */ |
|
| 219 | public function up(Request $request, Member $Member) |
|
| 220 | { |
|
| 221 | $this->isTokenValid(); |
|
| 222 | ||
| 223 | try { |
|
| 224 | $this->memberRepository->up($Member); |
|
| 225 | ||
| 226 | $this->addSuccess('admin.member.up.complete', 'admin'); |
|
| 227 | } catch (\Exception $e) { |
|
| 228 | log_error('メンバー表示順更新エラー', [$Member->getId(), $e]); |
|
| 229 | ||
| 230 | $this->addError('admin.member.up.error', 'admin'); |
|
| 231 | } |
|
| 232 | ||
| 233 | return $this->redirectToRoute('admin_setting_system_member'); |
|
| 234 | } |
|
| 235 | ||
| 236 | /** |
|
| 237 | * @Method("PUT") |
|
| @@ 240-255 (lines=16) @@ | ||
| 237 | * @Method("PUT") |
|
| 238 | * @Route("/%eccube_admin_route%/setting/system/member/{id}/down", requirements={"id" = "\d+"}, name="admin_setting_system_member_down") |
|
| 239 | */ |
|
| 240 | public function down(Request $request, Member $Member) |
|
| 241 | { |
|
| 242 | $this->isTokenValid(); |
|
| 243 | ||
| 244 | try { |
|
| 245 | $this->memberRepository->down($Member); |
|
| 246 | ||
| 247 | $this->addSuccess('admin.member.down.complete', 'admin'); |
|
| 248 | } catch (\Exception $e) { |
|
| 249 | log_error('メンバー表示順更新エラー', [$Member->getId(), $e]); |
|
| 250 | ||
| 251 | $this->addError('admin.member.down.error', 'admin'); |
|
| 252 | } |
|
| 253 | ||
| 254 | return $this->redirectToRoute('admin_setting_system_member'); |
|
| 255 | } |
|
| 256 | ||
| 257 | /** |
|
| 258 | * @Method("DELETE") |
|