| @@ 142-155 (lines=14) @@ | ||
| 139 | $this->tariff = $tariff; |
|
| 140 | } |
|
| 141 | ||
| 142 | public function insert(): bool |
|
| 143 | { |
|
| 144 | $data = $this->form->toArray(); |
|
| 145 | ||
| 146 | try { |
|
| 147 | $result = Tariff::perform('create', $data); |
|
| 148 | } catch (ResponseErrorException $e) { |
|
| 149 | throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e); |
|
| 150 | } |
|
| 151 | ||
| 152 | $this->form->id = $result['id']; |
|
| 153 | ||
| 154 | return true; |
|
| 155 | } |
|
| 156 | ||
| 157 | public function update(): bool |
|
| 158 | { |
|
| @@ 157-168 (lines=12) @@ | ||
| 154 | return true; |
|
| 155 | } |
|
| 156 | ||
| 157 | public function update(): bool |
|
| 158 | { |
|
| 159 | $data = $this->form->toArray(); |
|
| 160 | ||
| 161 | try { |
|
| 162 | $result = Tariff::perform('update', $data); |
|
| 163 | } catch (ResponseErrorException $e) { |
|
| 164 | throw new UnprocessableEntityHttpException($e->getMessage(), 0, $e); |
|
| 165 | } |
|
| 166 | ||
| 167 | return true; |
|
| 168 | } |
|
| 169 | } |
|
| 170 | ||