| @@ 21-39 (lines=19) @@ | ||
| 18 | /** |
|
| 19 | * {@inheritdoc} |
|
| 20 | */ |
|
| 21 | public function latest(): Profile |
|
| 22 | { |
|
| 23 | $row = $this->db->getLatest(); |
|
| 24 | ||
| 25 | return new Profile([ |
|
| 26 | '_id' => $row['id'], |
|
| 27 | 'meta' => [ |
|
| 28 | 'url' => $row['url'], |
|
| 29 | 'SERVER' => json_decode($row['SERVER'], true), |
|
| 30 | 'get' => json_decode($row['GET'], true), |
|
| 31 | 'env' => json_decode($row['ENV'], true), |
|
| 32 | 'simple_url' => $row['simple_url'], |
|
| 33 | 'request_ts' => (int) $row['request_ts'], |
|
| 34 | 'request_ts_micro' => $row['request_ts_micro'], |
|
| 35 | 'request_date' => $row['request_date'], |
|
| 36 | ], |
|
| 37 | 'profile' => json_decode($row['profile'], true), |
|
| 38 | ]); |
|
| 39 | } |
|
| 40 | ||
| 41 | /** |
|
| 42 | * {@inheritdoc} |
|
| @@ 52-70 (lines=19) @@ | ||
| 49 | /** |
|
| 50 | * {@inheritdoc} |
|
| 51 | */ |
|
| 52 | public function get($id): Profile |
|
| 53 | { |
|
| 54 | $row = $this->db->getById($id); |
|
| 55 | ||
| 56 | return new Profile([ |
|
| 57 | '_id' => $id, |
|
| 58 | 'meta' => [ |
|
| 59 | 'url' => $row['url'], |
|
| 60 | 'SERVER' => json_decode($row['SERVER'], true), |
|
| 61 | 'get' => json_decode($row['GET'], true), |
|
| 62 | 'env' => json_decode($row['ENV'], true), |
|
| 63 | 'simple_url' => $row['simple_url'], |
|
| 64 | 'request_ts' => (int) $row['request_ts'], |
|
| 65 | 'request_ts_micro' => $row['request_ts_micro'], |
|
| 66 | 'request_date' => $row['request_date'], |
|
| 67 | ], |
|
| 68 | 'profile' => json_decode($row['profile'], true), |
|
| 69 | ]); |
|
| 70 | } |
|
| 71 | ||
| 72 | /** |
|
| 73 | * {@inheritdoc} |
|