Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
workgroupevent.php
1<?php
2
4
12{
13 private array $oldFields = [];
14 private array $newFields = [];
15
16 public function getOldFields(): array
17 {
18 return $this->oldFields;
19 }
20
21 public function getNewFields(): array
22 {
23 return $this->newFields;
24 }
25
26 public function setData(array $data = []): self
27 {
28 $this->data = $this->prepareData($data);
29
30 $this->collectOldData();
31
32 return $this;
33 }
34
35 private function collectOldData(): void
36 {
37 $groupId = $this->getGroupId();
38
39 if (
40 $groupId
41 && empty($this->oldFields)
42 )
43 {
44 $this->oldFields = $this->getGroupFields($groupId);
45 }
46 }
47
48 public function collectNewData(): void
49 {
50 $groupId = $this->getGroupId();
51 if (
52 $groupId
53 && empty($this->newFields)
54 )
55 {
56 $this->newFields = $this->getGroupFields($groupId);
57 }
58 }
59
60 private function getGroupFields(int $groupId): array
61 {
62 $fields = \CSocNetGroup::getById($groupId);
63 return is_array($fields)
64 ? $fields
65 : [];
66 }
67}