Conditions | 4 |
Paths | 8 |
Total Lines | 22 |
Code Lines | 12 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
1 | <?php |
||
9 | public function toArray($request) |
||
10 | { |
||
11 | $data = [ |
||
12 | 'id' => $this->id, |
||
|
|||
13 | 'map_id' => $this->map_id, |
||
14 | 'display_name' => $this->display_name, |
||
15 | 'year' => $this->year, |
||
16 | ]; |
||
17 | |||
18 | if ($this->investors_count !== null) { |
||
19 | $data['investors'] = $this->investors_count; |
||
20 | } |
||
21 | |||
22 | if ($this->online_count !== null) { |
||
23 | $data['online'] = $this->online_count; |
||
24 | } |
||
25 | |||
26 | if ($this->updated_at !== null) { |
||
27 | $data['updated_at'] = $this->updated_at->format('Y-m-d H:i:s'); |
||
28 | } |
||
29 | |||
30 | return $data; |
||
31 | } |
||
32 | } |