| @@ 111-121 (lines=11) @@ | ||
| 108 | * @param ExchangeRate $rate |
|
| 109 | * @return TRUE if successful. |
|
| 110 | */ |
|
| 111 | protected function save(ExchangeRate $rate) |
|
| 112 | { |
|
| 113 | try { |
|
| 114 | $this->get('runopencode.exchange_rate.repository')->save([$rate]); |
|
| 115 | $this->addFlash('success', $this->get('translator')->trans('flash.create.success', [], 'runopencode_exchange_rate')); |
|
| 116 | return true; |
|
| 117 | } catch (\Exception $e) { |
|
| 118 | $this->addFlash('error', $this->get('translator')->trans('flash.create.error.unknown', [], 'runopencode_exchange_rate')); |
|
| 119 | return false; |
|
| 120 | } |
|
| 121 | } |
|
| 122 | ||
| 123 | /** |
|
| 124 | * Redirect after success. |
|
| @@ 124-134 (lines=11) @@ | ||
| 121 | * @param Rate $rate |
|
| 122 | * @return TRUE if successful. |
|
| 123 | */ |
|
| 124 | protected function save(Rate $rate) |
|
| 125 | { |
|
| 126 | try { |
|
| 127 | $this->get('runopencode.exchange_rate.repository')->save([$rate]); |
|
| 128 | $this->addFlash('success', $this->get('translator')->trans('flash.edit.success', [], 'runopencode_exchange_rate')); |
|
| 129 | return true; |
|
| 130 | } catch (\Exception $e) { |
|
| 131 | $this->addFlash('error', $this->get('translator')->trans('flash.edit.error.unknown', [], 'runopencode_exchange_rate')); |
|
| 132 | return false; |
|
| 133 | } |
|
| 134 | } |
|
| 135 | ||
| 136 | /** |
|
| 137 | * Redirect after success. |
|