1C-Bitrix 25.700.0
Загрузка...
Поиск...
Не найдено
uffieldassembler.php
См. документацию.
1<?php
2
3namespace Bitrix\Main\Grid\Row\Assembler\Field;
4
5use Bitrix\Main\Grid\Row\FieldAssembler;
6
8{
9 private string $entityId;
10 private array $fields;
11
12 public function __construct(string $entityId)
13 {
14 $this->entityId = $entityId;
15
16 parent::__construct(
17 array_keys(
18 $this->getFields()
19 )
20 );
21 }
22
23 private function getFields(): array
24 {
26
30
31 if (!isset($this->fields))
32 {
33 $this->fields = [];
34
35 $fields = $USER_FIELD_MANAGER->GetUserFields($this->entityId);
36 foreach ($fields as $field)
37 {
38 if ($field['SHOW_IN_LIST'] !== 'Y')
39 {
40 continue;
41 }
42
43 $this->fields[$field['FIELD_NAME']] = $field;
44 }
45 }
46
47 return $this->fields;
48 }
49
50 protected function prepareRow(array $row): array
51 {
52 if (empty($this->getColumnIds()))
53 {
54 return $row;
55 }
56
57 $row['columns'] ??= [];
58
59 foreach ($this->getColumnIds() as $columnId)
60 {
61 $row['columns'][$columnId] = $this->prepareUf($row['data'][$columnId] ?? null, $columnId);
62 }
63
64 return $row;
65 }
66
67 private function prepareUf(mixed $value, string $columnId)
68 {
69 $field = $this->getFields()[$columnId] ?? null;
70 if (empty($field))
71 {
72 return $value;
73 }
74
75 $callback = $field['USER_TYPE']['VIEW_CALLBACK'] ?? null;
76 if (is_callable($callback))
77 {
78 $field['VALUE'] = $value;
79
80 return call_user_func($callback, $field);
81 }
82
83 return $value;
84 }
85}
</td ></tr ></table ></td ></tr >< tr >< td class="bx-popup-label bx-width30"><?=GetMessage("PAGE_NEW_TAGS")?> array( $site)
Определения file_new.php:804
global $USER_FIELD_MANAGER
Определения attempt.php:6
$fields
Определения yandex_run.php:501