| Conditions | 4 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 43 | private function createOrUpdateAddress(string $key = 'address') |
||
| 44 | { |
||
| 45 | // Confirm address data has passed to the request |
||
| 46 | if ($this->request->has("{$key}.city") && $this->request->input("{$key}.city")) { |
||
| 47 | // Update Address if it exists |
||
| 48 | if ($this->model->address) { |
||
| 49 | return $this->updateAddress($key); |
||
| 50 | } |
||
| 51 | |||
| 52 | // Create the Address if it doesn't exist |
||
| 53 | else { |
||
| 54 | return $this->createAddress($key); |
||
| 55 | } |
||
| 56 | } |
||
| 57 | |||
| 58 | return false; |
||
| 59 | } |
||
| 61 |