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