-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathEventLog.php
46 lines (36 loc) · 996 Bytes
/
EventLog.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<?php
// Copyright 1999-2025. WebPros International GmbH.
namespace PleskX\Api\Operator;
use PleskX\Api\Struct\EventLog as Struct;
class EventLog extends \PleskX\Api\Operator
{
protected string $wrapperTag = 'event_log';
/**
* @return Struct\Event[]
*/
public function get(): array
{
$records = [];
$response = $this->request('get');
foreach ($response->event ?? [] as $eventInfo) {
$records[] = new Struct\Event($eventInfo);
}
return $records;
}
/**
* @return Struct\DetailedEvent[]
*/
public function getDetailedLog(): array
{
$records = [];
$response = $this->request('get_events');
foreach ($response->event ?? [] as $eventInfo) {
$records[] = new Struct\DetailedEvent($eventInfo);
}
return $records;
}
public function getLastId(): int
{
return (int) $this->request('get-last-id')->getValue('id');
}
}