src/Controller/PodnetController.php line 38

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Services\CiselnikObci;
  4. use App\Services\Ciselniky;
  5. use App\Services\MailNotificator;
  6. use Symfony\Component\HttpFoundation\Request;
  7. use Symfony\Component\Routing\Annotation\Route;
  8. use App\Controller\NoticeController;
  9. use App\Entity\Notice;
  10. /**
  11.  * Podnet controller.
  12.  *
  13.  * @Route("/podnet")
  14.  */
  15. class PodnetController extends NoticeController {
  16.     public function __construct() {
  17.         $this->type 'podnet';
  18.     }
  19.     /**
  20.      * @Route("/", name="podnet")
  21.      * @Route("/new/", name="podnet-new")
  22.      */
  23.     public function podnetNewAction(
  24.         Request         $request,
  25.         MailNotificator $mailNotificator,
  26.         CiselnikObci    $ciselnikObci,
  27.         Ciselniky       $ciselniky
  28.     ) {
  29.         if (isset(($request->request->get('notice'))['podnet']['agree'])) {
  30.             $this->addFlash('warning''podnet-robots');
  31.             return $this->redirectToRoute('podnet');
  32.         }
  33.         return $this->newAction($request$mailNotificator$ciselnikObci$ciselniky);
  34.     }
  35.     /**
  36.      * @Route("/edit/{id}", name="podnet-edit", requirements={"id"="\d+"})
  37.      */
  38.     public function podnetEditAction(
  39.         Request         $request,
  40.         MailNotificator $mailNotificator,
  41.         CiselnikObci    $ciselnikObci,
  42.         Ciselniky       $ciselniky,
  43.                         $id
  44.     ) {
  45.         return $this->editAction($request$mailNotificator$ciselnikObci$ciselniky$id);
  46.     }
  47.     /**
  48.      * @Route("/view/{id}", name="podnet-view", requirements={"id"="\d+"})
  49.      */
  50.     public function podnetViewAction(Notice $notice) {
  51.         return $this->viewAction($notice);
  52.     }
  53.     /**
  54.      * @Route("/result/{id}", name="podnet-result", requirements={"id"="\d+"})
  55.      */
  56.     public function podnetResultAction(
  57.         Request   $request,
  58.         Ciselniky $ciselniky,
  59.                   $id
  60.     ) {
  61.         return $this->resultAction($request$ciselniky$id);
  62.     }
  63. }