12 parent::__construct();
19 public function create(array $sourceFilter)
21 $result = parent::create($sourceFilter);
23 if (!empty($this->fields) && !empty($sourceFilter))
39 $this->fieldTypeHandlers = [
40 'string' =>
'addStringValue',
41 'number' =>
'addNumberValue',
42 'date' =>
'addDateValue',
43 'custom_date' =>
'addCustomDateValue',
44 'list' =>
'addListValue',
45 'checkbox' =>
'addCheckboxValue',
46 'dest_selector' =>
'addDestSelectorValue',
47 'custom_entity' =>
'',
61 if (isset($value[
'VALUE']) && is_string($value[
'VALUE']) && $value[
'VALUE'] !==
'')
63 $result[
'FIND'] = $value[
'VALUE'];
74 protected function addStringValue(array &$result, $fieldId, array $field, array $value)
76 if (isset($value[
'VALUE']) && is_string($value[
'VALUE']) && $value[
'VALUE'] !==
'')
78 $result[$fieldId] = $value[
'VALUE'];
89 protected function addNumberValue(array &$result, $fieldId, array $field, array $value)
91 if (isset($value[
'SUB_TYPE']))
93 $result[$fieldId.
'_numsel'] = $value[
'SUB_TYPE'];
94 $result[$fieldId.
'_from'] = (isset($value[
'_from']) ? $value[
'_from'] :
'');
95 $result[$fieldId.
'_to'] = (isset($value[
'_to']) ? $value[
'_to'] :
'');
106 protected function addDateValue(array &$result, $fieldId, array $field, array $value)
108 if (isset($value[
'SUB_TYPE']))
110 $result[$fieldId.
'_datesel'] = $value[
'SUB_TYPE'];
111 $result[$fieldId.
'_from'] = (isset($value[
'_from']) ? $value[
'_from'] :
'');
112 $result[$fieldId.
'_to'] = (isset($value[
'_to']) ? $value[
'_to'] :
'');
113 $result[$fieldId.
'_days'] = (isset($value[
'_days']) ? $value[
'_days'] :
'');
114 $result[$fieldId.
'_month'] = (isset($value[
'_month']) ? $value[
'_month'] :
'');
115 $result[$fieldId.
'_quarter'] = (isset($value[
'_quarter']) ? $value[
'_quarter'] :
'');
116 $result[$fieldId.
'_year'] = (isset($value[
'_year']) ? $value[
'_year'] :
'');
117 $result[$fieldId.
'_allow_year'] = (isset($value[
'_allow_year']) ? $value[
'_allow_year'] :
'');
130 if (isset($value[
'days']) || isset($value[
'months']) || isset($value[
'years']))
132 $result[$fieldId.
'days'] = (isset($value[
'days']) ? $value[
'days'] :
'');
133 $result[$fieldId.
'months'] = (isset($value[
'months']) ? $value[
'months'] :
'');
134 $result[$fieldId.
'years'] = (isset($value[
'years']) ? $value[
'years'] :
'');
145 protected function addListValue(array &$result, $fieldId, array $field, array $value)
147 if (isset($field[
'params'][
'multiple']) && $field[
'params'][
'multiple'] =
'Y')
151 foreach ($value as $row)
153 if (!empty($row) && is_array($row) && isset($row[
'VALUE']))
155 $list[] = $row[
'VALUE'];
162 $result[$fieldId] = $list;
168 if (isset($value[
'VALUE']))
170 $result[$fieldId] = $value[
'VALUE'];
185 isset($value[
'VALUE'])
186 && ($value[
'VALUE'] ===
'Y' || $value[
'VALUE'] ===
'N')
189 $result[$fieldId] = $value[
'VALUE'];
203 isset($value[
'_value'])
204 && (isset($value[
'_label']))
207 $result[$fieldId] = $value[
'_value'];
208 $result[$fieldId.
'_label'] = $value[
'_label'];
addNumberValue(array &$result, $fieldId, array $field, array $value)
addCheckboxValue(array &$result, $fieldId, array $field, array $value)
addDateValue(array &$result, $fieldId, array $field, array $value)
addCustomDateValue(array &$result, $fieldId, array $field, array $value)
addStringValue(array &$result, $fieldId, array $field, array $value)
addListValue(array &$result, $fieldId, array $field, array $value)
addDestSelectorValue(array &$result, $fieldId, array $field, array $value)
addQuickSearchValue(array &$result, $fieldId, array $field, array $value)
create(array $sourceFilter)