| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 10 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 25 | public function address(bool $obj = false): User |
||
| 26 | { |
||
| 27 | $this->relational_fields[] = 'address'; |
||
| 28 | |||
| 29 | if ($obj) { |
||
| 30 | $this->address = (new Address())->findByUser($this->id); |
||
| 31 | return $this; |
||
| 32 | } |
||
| 33 | |||
| 34 | $address = (new Address())->findByUser($this->id); |
||
| 35 | if (empty($address)) { |
||
| 36 | $this->address = null; |
||
| 37 | } else { |
||
| 38 | $this->address = (new Address())->findByUser($this->id)->data(); |
||
| 39 | } |
||
| 40 | return $this; |
||
| 41 | } |
||
| 68 | } |