Ejemplo n.º 1
0
 /**
  * Will automatically attempt to save an object when
  * called
  */
 public function saveAction($modelType = '')
 {
     $model = null;
     try {
         $params = $this->filterParams($this->_getAllParams());
         $model = $this->expenseService->saveExpense($params);
     } catch (InvalidModelException $ime) {
         $this->flash($ime->getMessages());
         $model = new Expense();
         $model->bind($this->_getAllParams());
         $this->editAction($model);
         return;
     }
     $this->onModelSaved($model);
 }