src/Controller/OznamenieController.php line 27

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Controller\NoticeController;
  4. use App\Services\CiselnikObci;
  5. use App\Services\Ciselniky;
  6. use App\Services\MailNotificator;
  7. use Symfony\Component\HttpFoundation\Request;
  8. use App\Entity\Notice;
  9. use Symfony\Component\Routing\Annotation\Route;
  10. /**
  11.  * Oznamenie controller.
  12.  *
  13.  * @Route("oznamenie")
  14.  */
  15. class OznamenieController extends NoticeController {
  16.     public function __construct() {
  17.         $this->type 'oznamenie';
  18.     }
  19.     /**
  20.      * @Route("/", name="oznamenie")
  21.      */
  22.     public function oznameniePublicAction(Request $request) {
  23.         $noticeRep $this->getDoctrine()->getManager()->getRepository(Notice::class);
  24.         $notices $noticeRep->findPublicOznamenia();
  25.         $this->checkUser();
  26.         return $this->render('notice/notice_public_oznamenie.html.twig', [
  27.             'notices' => $notices,
  28.         ]);
  29.     }
  30.     /**
  31.      * @Route("/new/", name="oznamenie-new")
  32.      */
  33.     public function oznamenieNewAction(
  34.         Request         $request,
  35.         MailNotificator $mailNotificator,
  36.         CiselnikObci    $ciselnikObci,
  37.         Ciselniky       $ciselniky
  38.     ) {
  39.         return $this->newAction($request$mailNotificator$ciselnikObci$ciselniky);
  40.     }
  41.     /**
  42.      * @Route("/edit/{id}", name="oznamenie-edit", requirements={"id"="\d+"})
  43.      */
  44.     public function oznamenieEditAction(
  45.         Request         $request,
  46.         MailNotificator $mailNotificator,
  47.         CiselnikObci    $ciselnikObci,
  48.         Ciselniky       $ciselniky,
  49.                         $id
  50.     ) {
  51.         return $this->editAction($request$mailNotificator$ciselnikObci$ciselniky$id);
  52.     }
  53.     /**
  54.      * @Route("/view/{id}", name="oznamenie-view", requirements={"id"="\d+"})
  55.      */
  56.     public function oznamenieViewAction(Notice $notice) {
  57.         return $this->viewAction($notice);
  58.     }
  59.     /**
  60.      * @Route("/result/{id}", name="oznamenie-result", requirements={"id"="\d+"})
  61.      */
  62.     public function oznamenieResultAction(
  63.         Request   $request,
  64.         Ciselniky $ciselniky,
  65.                   $id
  66.     ) {
  67.         return $this->resultAction($request$ciselniky$id);
  68.     }
  69. }