Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
CRAP | |
0.00% |
0 / 1 |
AccessLogsEntityDao | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 | |
0.00% |
0 / 1 |
insertAccessLog | |
0.00% |
0 / 18 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | declare(strict_types=1); |
4 | |
5 | namespace PeServer\App\Models\Dao\Entities; |
6 | |
7 | use PeServer\App\Models\Data\Dto\AccessLogDto; |
8 | use PeServer\Core\Database\DaoBase; |
9 | use PeServer\Core\Database\DaoTrait; |
10 | use PeServer\Core\Database\IDatabaseContext; |
11 | |
12 | class AccessLogsEntityDao extends DaoBase |
13 | { |
14 | use DaoTrait; |
15 | |
16 | #region function |
17 | |
18 | public function insertAccessLog(AccessLogDto $accessLog): void |
19 | { |
20 | $this->context->insertSingle( |
21 | <<<SQL |
22 | |
23 | insert into |
24 | access_logs |
25 | ( |
26 | timestamp, |
27 | client_ip, |
28 | client_host, |
29 | request_id, |
30 | session, |
31 | ua, |
32 | method, |
33 | path, |
34 | query, |
35 | fragment, |
36 | referer, |
37 | running_time |
38 | ) |
39 | values |
40 | ( |
41 | :timestamp, |
42 | :clientIp, |
43 | :clientHost, |
44 | :requestId, |
45 | :session, |
46 | :ua, |
47 | :method, |
48 | :path, |
49 | :query, |
50 | :fragment, |
51 | :referer, |
52 | :runningTime |
53 | ) |
54 | |
55 | SQL, |
56 | [ |
57 | 'timestamp' => $accessLog->timestamp, |
58 | 'clientIp' => $accessLog->clientIp, |
59 | 'clientHost' => $accessLog->clientHost, |
60 | 'requestId' => $accessLog->requestId, |
61 | 'session' => $accessLog->session, |
62 | 'ua' => $accessLog->ua, |
63 | 'method' => $accessLog->method, |
64 | 'path' => $accessLog->path, |
65 | 'query' => $accessLog->query, |
66 | 'fragment' => $accessLog->fragment, |
67 | 'referer' => $accessLog->referer, |
68 | 'runningTime' => $accessLog->runningTime, |
69 | ] |
70 | ); |
71 | } |
72 | |
73 | #endregion |
74 | } |