SHARE
TWEET

Untitled

a guest Aug 23rd, 2019 71 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2.  
  3. public function deleteAction()
  4. {
  5.     $toDoId = $this->params()->fromRoute('id', -1);
  6.  
  7.     $toDo = $this->entityManager->getRepository(ToDo::class)->findOneById($toDoId);
  8.     if ($toDo == null) {
  9.         $this->getResponse()->setStatusCode(404);
  10.         return;
  11.     }
  12.  
  13.     $this->toDoManager->removeToDo($toDo);
  14.  
  15.     $this->redirect()->toUrl('/');
  16. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top