Ejemplo n.º 1
0
 /**
  * @before _secured, _admin
  */
 public function delete($id)
 {
     $this->willRenderActionView = false;
     $this->willRenderLayoutView = false;
     $exam = App_Model_Exam::first(array('id = ?' => (int) $id), array('id'));
     if (NULL === $exam) {
         echo self::ERROR_MESSAGE_2;
     } else {
         if ($exam->delete()) {
             Event::fire('admin.log', array('success', 'Exam Id: ' . $id));
             echo 'success';
         } else {
             Event::fire('admin.log', array('fail', 'Exam Id: ' . $id));
             echo self::ERROR_MESSAGE_1;
         }
     }
 }