Documentation

getFilter

array public
\Bitrix\Main\UI\Filter\Options::getFilter(
 array $sourceFields = array()
);

Method returns current filter value.

Parameters

ParameterDescriptionVersion
$sourceFieldsArray with $arParams["FILTER"] filter fields.

Returned values for various field types:
  • string (string) - returns field values as “id поля” => “Field value”;
  • list (list) - for list with singular selection, returns values as "field id" => "Selected item value", for the list with multiple selection "field id" => "Array with selected items' values";
  • custom_date (arbitrary date) - retuned value:
    "DATE_CREATE_days" => array("1", "2"),
    "DATE_CREATE_months" => array("4", "8"),
    "DATE_CREATE_years" => array("2017")
  • date (date) - field value will be returned as set of fields with postfixes _datesel, _from, _to, _days, _year, _quarter.
    "FIELD_datesel" => "Value type",
    "FIELD_from" => "Range start",
    "FIELD_to" => "Range end",
    "FIELD_days" => "Number of days",
    "FIELD_year" => "Year",
    "FIELD_quarter" => "Quarter number",
    "FIELD_month" => "Month sequence number. Without leading zero"
    
  • number (numerical) - field value will be returned as several fields with postfixes _numsel, _from, _to.
    "FIELD_numsel" => "Value type",
    "FIELD_from" => "Range start",
    "FIELD_to" => "Range end"
    
  • checkbox (checkbox) - the key valueType for checkbox type field can accept the "numeric" value or an empty string. When "numeric" is specified, returns 1|0 as the value. If not specified or не указано или указано значение отличное от "numeric", то будет возвращаться Y|N.

Example



© «Bitrix24», 2001-2024
Up