Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- public function deleteAction()
- {
- $toDoId = $this->params()->fromRoute('id', -1);
- $toDo = $this->entityManager->getRepository(ToDo::class)->findOneById($toDoId);
- if ($toDo == null) {
- $this->getResponse()->setStatusCode(404);
- return;
- }
- $this->toDoManager->removeToDo($toDo);
- $this->redirect()->toUrl('/');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement