17 private int $iblockId;
25 $this->iblockId = $iblockId;
26 $this->gridProvider = $gridProvider;
35 'ID' =>
"iblock_property_{$this->iblockId}",
38 return $this->settings;
56 'name' => $this->gridProvider->getFieldName(
'NAME'),
60 'name' => $this->gridProvider->getFieldName(
'CODE'),
63 'name' => $this->gridProvider->getFieldName(
'ACTIVE'),
74 'name' => $this->gridProvider->getFieldName(
'SEARCHABLE'),
84 'name' => $this->gridProvider->getFieldName(
'FILTRABLE'),
93 'IS_REQUIRED' => $this->
createField(
'IS_REQUIRED', [
94 'name' => $this->gridProvider->getFieldName(
'IS_REQUIRED'),
104 'name' => $this->gridProvider->getFieldName(
'MULTIPLE'),
114 'name' => $this->gridProvider->getFieldName(
'XML_ID'),
116 'PROPERTY_TYPE' => $this->
createField(
'PROPERTY_TYPE', [
117 'name' => $this->gridProvider->getFieldName(
'PROPERTY_TYPE'),
121 'items' => $this->getPropertyTypes(),
132 private function getPropertyTypes(): array
136 $baseTypes = Property::getBaseTypeList(
true);
137 foreach ($baseTypes as $type => $name)
139 $result[$type] = $name;
142 $userTypes = CIBlockProperty::GetUserType();
143 Collection::sortByColumn($userTypes, [
144 'DESCRIPTION' => SORT_STRING,
147 foreach ($userTypes as $type => $item)
149 $key =
"{$item['PROPERTY_TYPE']}:{$type}";
150 $result[$key] = $item[
'DESCRIPTION'];
169 $isEmpty = empty($rawFilterValue);
170 $rawFilterValue[
'=IBLOCK_ID'] = $this->iblockId;
174 return $rawFilterValue;
178 if (isset($rawFilterValue[
'PROPERTY_TYPE']))
180 $parts = explode(
':', $rawFilterValue[
'PROPERTY_TYPE']);
181 if (count($parts) === 2)
183 $rawFilterValue[
'PROPERTY_TYPE'] = $parts[0];
184 $rawFilterValue[
'USER_TYPE'] = $parts[1];
189 $filterOperations = [
195 'IS_REQUIRED' =>
'=',
198 'PROPERTY_TYPE' =>
'=',
201 foreach ($rawFilterValue as $field => $value)
203 $operator = $filterOperations[$field] ??
null;
204 if (isset($operator))
206 $rawFilterValue[$operator . $field] = $value;
207 unset($rawFilterValue[$field]);
212 if (isset($rawFilterValue[
'FIND']))
214 $rawFilterValue[] = [
215 '?NAME' => $rawFilterValue[
'FIND'],
219 return $rawFilterValue;
createField($fieldID, array $params=null)
static getMessage($code, $replace=null, $language=null)