<?php
namespace App\Controller;
use App\Controller\NoticeController;
use App\Services\CiselnikObci;
use App\Services\Ciselniky;
use App\Services\MailNotificator;
use Symfony\Component\HttpFoundation\Request;
use App\Entity\Notice;
use Symfony\Component\Routing\Annotation\Route;
/**
* Oznamenie controller.
*
* @Route("oznamenie")
*/
class OznamenieController extends NoticeController {
public function __construct() {
$this->type = 'oznamenie';
}
/**
* @Route("/", name="oznamenie")
*/
public function oznameniePublicAction(Request $request) {
$noticeRep = $this->getDoctrine()->getManager()->getRepository(Notice::class);
$notices = $noticeRep->findPublicOznamenia();
$this->checkUser();
return $this->render('notice/notice_public_oznamenie.html.twig', [
'notices' => $notices,
]);
}
/**
* @Route("/new/", name="oznamenie-new")
*/
public function oznamenieNewAction(
Request $request,
MailNotificator $mailNotificator,
CiselnikObci $ciselnikObci,
Ciselniky $ciselniky
) {
return $this->newAction($request, $mailNotificator, $ciselnikObci, $ciselniky);
}
/**
* @Route("/edit/{id}", name="oznamenie-edit", requirements={"id"="\d+"})
*/
public function oznamenieEditAction(
Request $request,
MailNotificator $mailNotificator,
CiselnikObci $ciselnikObci,
Ciselniky $ciselniky,
$id
) {
return $this->editAction($request, $mailNotificator, $ciselnikObci, $ciselniky, $id);
}
/**
* @Route("/view/{id}", name="oznamenie-view", requirements={"id"="\d+"})
*/
public function oznamenieViewAction(Notice $notice) {
return $this->viewAction($notice);
}
/**
* @Route("/result/{id}", name="oznamenie-result", requirements={"id"="\d+"})
*/
public function oznamenieResultAction(
Request $request,
Ciselniky $ciselniky,
$id
) {
return $this->resultAction($request, $ciselniky, $id);
}
}