Example #1
0
 public function deleteAction()
 {
     $this->fa->readOnly();
     $id = (int) $this->getParam('id');
     $record = Journal::getRepository()->findOneBy(array('id' => $id, 'user_id' => $this->user->id));
     if (!$record instanceof Journal) {
         throw new \FA\Exception('Journal entry not found!');
     }
     $record->delete();
     $this->alert('<b>Journal deleted!</b>', 'green');
     return $this->redirectFromHere(array('action' => 'index', 'id' => NULL));
 }