1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
CollabRegistry.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
12
14{
15 private static ?self $instance = null;
16
17 public static function getInstance(): static
18 {
19 if (static::$instance === null)
20 {
21 static::$instance = new static();
22 }
23
24 return static::$instance;
25 }
26
27 public function get(int $groupId): ?Collab
28 {
29 $group = parent::get($groupId);
30 if ($group instanceof Collab)
31 {
32 return $group;
33 }
34
35 return null;
36 }
37
38 protected function loadData(int $groupId): array
39 {
40 $fields = parent::loadData($groupId);
41
42 if (empty($fields))
43 {
44 return $fields;
45 }
46
48
49 return $fields;
50 }
51
52 protected function onObjectAlreadyLoaded(?Workgroup $group): void
53 {
54 if (!$group instanceof Collab)
55 {
56 return;
57 }
58
59 $fields = $group->getFields();
60
62
63 $group->setFields($fields);
64 }
65
66 protected function loadAdditionalData(array &$fields): void
67 {
68 if (!array_key_exists('OPTIONS', $fields))
69 {
70 $this->fillOptions($fields);
71 }
72
73 if (!array_key_exists('PERMISSIONS', $fields))
74 {
75 $this->fillPermissions($fields);
76 }
77 }
78
79 private function fillOptions(array &$fields): void
80 {
81 $options = CollabOptionProvider::getInstance()->get((int)$fields['ID']);
82 if (!empty($options))
83 {
84 $fields['OPTIONS'] = $options;
85 }
86 }
87
88 private function fillPermissions(array &$fields): void
89 {
90 $permissions = FeatureProvider::getInstance()->getPermissions((int)$fields['ID']);
91 if (!empty($permissions))
92 {
93 $fields['PERMISSIONS'] = $permissions;
94 }
95 }
96}
onObjectAlreadyLoaded(?Workgroup $group)
Определения CollabRegistry.php:52
$options
Определения commerceml2.php:49
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
$fields
Определения yandex_run.php:501