1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
groupentity.php
См. документацию.
1<?php
2
3declare(strict_types=1);
4
6
10use Bitrix\Socialnetwork\Item\Workgroup\Type;
11
13{
14 public static function wakeUpObject(null|array|Arrayable $data): static
15 {
16 if ($data instanceof Arrayable)
17 {
18 $data = $data->toArray();
19 }
20
21 if (!is_array($data))
22 {
23 return new static();
24 }
25
26 $fields = static::$dataClass::getEntity()->getFields();
27
28 $wakeUpData = [];
29 $customData = [];
30 foreach ($data as $field => $value)
31 {
32 if (array_key_exists($field, $fields))
33 {
34 if (
35 $fields[$field] instanceof UserTypeField
36 && is_array($value)
37 && isset($value['VALUE'])
38 )
39 {
40 $value = $value['VALUE'];
41 }
42
43 $wakeUpData[$field] = $value;
44 }
45 else
46 {
47 $customData[$field] = $value;
48 }
49 }
50
51 $object = parent::wakeUp($wakeUpData);
52 foreach ($customData as $field => $value)
53 {
54 $object->customData->set($field, $value);
55 }
56
57 return $object;
58 }
59
60 public function isProject(): bool
61 {
62 return $this->typeIs(Type::Project);
63 }
64
65 public function isScrum(): bool
66 {
67 return $this->typeIs(Type::Scrum);
68 }
69
70 public function isGroup(): bool
71 {
72 return $this->typeIs(Type::Group);
73 }
74
75 public function typeIs(Type $type): bool
76 {
77 return $this->getType() === $type->value;
78 }
79}
$type
Определения options.php:106
static wakeUpObject(null|array|Arrayable $data)
Определения groupentity.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
Определения collection.php:2
$fields
Определения yandex_run.php:501