Total Complexity | 10 |
Total Lines | 56 |
Duplicated Lines | 0 % |
Changes | 0 |
1 | <?php |
||
8 | final class CreateActivityLogMessage implements CreateActivityLogMessageInterface |
||
9 | { |
||
10 | private string $actionName; |
||
11 | private \DateTime $dateTime; |
||
12 | private ?array $userInfo = null; |
||
13 | private ?string $requestUrl = null; |
||
14 | |||
15 | public function __construct(private readonly object $item, ?string $actionName = null) |
||
16 | { |
||
17 | $this->dateTime = new \DateTime(); |
||
18 | $this->actionName = $actionName ?? ActivityLogAction::CREATED; |
||
19 | } |
||
20 | |||
21 | public function getItem(): object |
||
22 | { |
||
23 | return $this->item; |
||
24 | } |
||
25 | |||
26 | public function getDateTime(): \DateTime |
||
27 | { |
||
28 | return $this->dateTime; |
||
29 | } |
||
30 | |||
31 | public function getActionName(): string |
||
32 | { |
||
33 | return $this->actionName; |
||
34 | } |
||
35 | |||
36 | public function getUser(): ?array |
||
37 | { |
||
38 | return $this->userInfo; |
||
39 | } |
||
40 | |||
41 | public function setUser(?array $userInfo): void |
||
42 | { |
||
43 | $this->userInfo = $userInfo; |
||
44 | } |
||
45 | |||
46 | public function getRequestUrl(): ?string |
||
47 | { |
||
48 | return $this->requestUrl; |
||
49 | } |
||
50 | |||
51 | public function setRequestUrl(?string $requestUrl): void |
||
52 | { |
||
53 | $this->requestUrl = $requestUrl; |
||
54 | } |
||
55 | |||
56 | public function getObjectId() |
||
59 | } |
||
60 | |||
61 | public function getClassName(): string |
||
64 | } |
||
65 | } |
||
66 |