public function updateTax(ArrayHash $values) { $tax = new MotivationTax((array) $values); try { $tax->setEditor($this->getUser()->getIdentity()); $this->taxService->updateTax($tax); } catch (Exceptions\DataErrorException $ex) { $this->handleDataSave($values->id, "this", $ex); } $this->redirect("default"); }
public function updateTax(MotivationTax $t) { try { $db = $this->taxDao->find($t->getId()); if ($db !== null) { $db->fromArray($t->toArray()); $db->setUpdated(new DateTime()); $this->taxEditorTypeHandle($db); $this->taxSeasonTypeHandle($db); $this->taxSportGroupTypeHandle($db); $this->entityManager->merge($db); $this->entityManager->flush(); $this->invalidateEntityCache($db); $this->onUpdate($db); } } catch (DuplicateEntryException $ex) { $this->logWarning($ex->getMessage()); throw new Exceptions\DuplicateEntryException($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); } catch (\Exception $ex) { $this->logError($ex->getMessage()); throw new Exceptions\DataErrorException($ex->getMessage(), $ex->getCode(), $ex->getPrevious()); } }