Пример #1
0
 /**
  * When leave is saved, we want to handle it manually
  * so that we can track who changed it, and what they
  * changed it to. 
  */
 public function saveAction()
 {
     try {
         $model = $this->byId();
         if (!$model) {
             throw new Exception("Failed to communicate");
         }
         $params = $this->filterParams();
         $model = $this->userService->updateLeave($model, $params['days']);
     } catch (InvalidModelException $ime) {
         $this->flash($ime->getMessages());
         $this->log->debug($ime->getTraceAsString(), Zend_Log::ERR);
         $model = new Leave();
         $model->bind($this->_getAllParams());
         $this->editAction($model);
         return;
     }
     $this->onModelSaved($model);
 }