1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
AbstractCollabLogEntry.php
См. документацию.
1<?php
2
4
8
9abstract class AbstractCollabLogEntry implements Arrayable
10{
11 protected ?int $id;
12 protected int $userId;
13 protected int $collabId;
15 protected ?CollabEntity $collabEntity = null;
16 private array $data = [];
17
18 abstract static public function getEventType(): string;
19
20 final public function __construct(
21 int $userId,
22 int $collabId,
24 ?int $id = null,
25 ?DateTime $dateTime = null,
26 )
27 {
28 $this->id = $id;
29 $this->userId = $userId;
30 $this->collabId = $collabId;
31 $this->collabEntity = $collabEntity;
32 $this->dateTime = $dateTime ?? new DateTime();
33 }
34
35 public function getId(): ?int
36 {
37 return $this->id;
38 }
39
40 public function setUserId(int $userId): static
41 {
42 $this->userId = $userId;
43
44 return $this;
45 }
46
47 public function getUserId(): int
48 {
49 return $this->userId;
50 }
51
52 public function setDateTime(DateTime $dateTime): static
53 {
54 $this->dateTime = $dateTime;
55
56 return $this;
57 }
58
59 public function getDateTime(): DateTime
60 {
61 return $this->dateTime;
62 }
63
64 public function setEntity(?CollabEntity $entity): static
65 {
66 $this->collabEntity = $entity;
67
68 return $this;
69 }
70
71 public function getEntity(): ?CollabEntity
72 {
74 }
75
76 public function setData(array $data): static
77 {
78 $this->data = $data;
79
80 return $this;
81 }
82
83 public function getData(): array
84 {
85 return $this->data;
86 }
87
88 public function getCollabId(): int
89 {
90 return $this->collabId;
91 }
92
93 public function setCollabId(int $collabId): static
94 {
95 $this->collabId = $collabId;
96
97 return $this;
98 }
99
100 protected function setDataValue(string $key, mixed $value): static
101 {
102 $this->data[$key] = $value;
103
104 return $this;
105 }
106
107 protected function getDataValue(string $key): mixed
108 {
109 return $this->data[$key] ?? null;
110 }
111
112 public function toArray(): array
113 {
114 $result = [
115 'USER_ID' => $this->getUserId(),
116 'COLLAB_ID' => $this->getCollabId(),
117 'TYPE' => $this->getEventType(),
118 'ENTITY_TYPE' => $this->getEntity()?->getType()->value,
119 'ENTITY_ID' => $this->getEntity()?->getId(),
120 'DATETIME' => $this->getDateTime(),
121 'DATA' => $this->getData(),
122 ];
123
124 if ($this->getId() > 0)
125 {
126 $result['ID'] = $this->getId();
127 }
128
129 return $result;
130 }
131}
Определения AbstractCollabLogEntry.php:10
getUserId()
Определения AbstractCollabLogEntry.php:47
getEntity()
Определения AbstractCollabLogEntry.php:71
getId()
Определения AbstractCollabLogEntry.php:35
getCollabId()
Определения AbstractCollabLogEntry.php:88
int $id
Определения AbstractCollabLogEntry.php:11
setEntity(?CollabEntity $entity)
Определения AbstractCollabLogEntry.php:64
setDataValue(string $key, mixed $value)
Определения AbstractCollabLogEntry.php:100
toArray()
Определения AbstractCollabLogEntry.php:112
setDateTime(DateTime $dateTime)
Определения AbstractCollabLogEntry.php:52
CollabEntity $collabEntity
Определения AbstractCollabLogEntry.php:15
int $userId
Определения AbstractCollabLogEntry.php:12
getDataValue(string $key)
Определения AbstractCollabLogEntry.php:107
getDateTime()
Определения AbstractCollabLogEntry.php:59
getData()
Определения AbstractCollabLogEntry.php:83
setData(array $data)
Определения AbstractCollabLogEntry.php:76
static getEventType()
setCollabId(int $collabId)
Определения AbstractCollabLogEntry.php:93
__construct(int $userId, int $collabId, ?CollabEntity $collabEntity=null, ?int $id=null, ?DateTime $dateTime=null,)
Определения AbstractCollabLogEntry.php:20
setUserId(int $userId)
Определения AbstractCollabLogEntry.php:40
int $collabId
Определения AbstractCollabLogEntry.php:13
DateTime $dateTime
Определения AbstractCollabLogEntry.php:14
$data['IS_AVAILABLE']
Определения .description.php:13
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$result
Определения get_property_values.php:14
$entity
if(empty($signedUserToken)) $key
Определения quickway.php:257