13 private array $oldFields = [];
14 private array $newFields = [];
18 return $this->oldFields;
23 return $this->newFields;
26 public function setData(array $data = []): self
28 $this->data = $this->prepareData($data);
30 $this->collectOldData();
35 private function collectOldData(): void
37 $groupId = $this->getGroupId();
41 && empty($this->oldFields)
44 $this->oldFields = $this->getGroupFields($groupId);
50 $groupId = $this->getGroupId();
53 && empty($this->newFields)
56 $this->newFields = $this->getGroupFields($groupId);
60 private function getGroupFields(
int $groupId): array
62 $fields = \CSocNetGroup::getById($groupId);
63 return is_array($fields)