Bitrix-D7 23.9
 
Загрузка...
Поиск...
Не найдено
destselectorfield.php
1<?php
9
15{
22 public function applyFilter(array &$filter = array())
23 {
24 $filterKey = $this->getFilterKey();
25 $filter[$filterKey] = $this->getValue();
26 $data = $this->getData();
27 $data['id'] = $filterKey;
28 \Bitrix\Crm\UI\Filter\EntityHandler::internalize([$data], $filter);
29 }
30
37 public function fetchFieldValue($filterFields)
38 {
39 $id = $this->getId();
40 $value = $filterFields[$id] ?? false;
41 if (!array_key_exists($id . '_label', $filterFields))
42 {
43 return $value ? [$id => $value] : [];
44 }
45 $label = $filterFields[$id . '_label'];
46
47 if (!$value || !$label)
48 return [];
49
50 return [
51 '_value' => $value,
52 '_label' => $label
53 ];
54 }
55
56 private function getData()
57 {
58 return $this->data;
59 }
60}