public function getParamsSort ($additionalFields = [])
        {
            $this->arParams['SORT_BY_1'] = trim ($this->arParams['SORT_BY_1']);

            if (strlen ($this->arParams['SORT_BY_1']) <= 0)
            {
                $this->arParams['SORT_BY_1'] = 'ACTIVE_FROM';
            }

            if (!preg_match ('/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i', $this->arParams['SORT_ORDER_1']))
            {
                $this->arParams['SORT_ORDER_1'] = 'DESC';
            }

            if (strlen ($this->arParams['SORT_BY_2']) <= 0)
            {
                $this->arParams['SORT_BY_2'] = 'SORT';
            }

            if (!preg_match ('/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i', $this->arParams['SORT_ORDER_2']))
            {
                $this->arParams['SORT_ORDER_2'] = 'ASC';
            }

            $fields = [
                $this->arParams['SORT_BY_1'] => $this->arParams['SORT_ORDER_1'],
                $this->arParams['SORT_BY_2'] => $this->arParams['SORT_ORDER_2'],
            ];

            if (is_array ($additionalFields) && !empty($additionalFields))
            {
                $fields = array_merge ($fields, $additionalFields);
            }

            return $fields;
        }
public function getParamsSort ($additionalFields = [])
        {
            $this->arParams['SORT_BY_1'] = trim ($this->arParams['SORT_BY_1']);

            if (strlen ($this->arParams['SORT_BY_1']) <= 0)
            {
                $this->arParams['SORT_BY_1'] = 'ACTIVE_FROM';
            }

            if (!preg_match ('/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i', $this->arParams['SORT_ORDER_1']))
            {
                $this->arParams['SORT_ORDER_1'] = 'DESC';
            }

            if (strlen ($this->arParams['SORT_BY_2']) <= 0)
            {
                $this->arParams['SORT_BY_2'] = 'SORT';
            }

            if (!preg_match ('/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i', $this->arParams['SORT_ORDER_2']))
            {
                $this->arParams['SORT_ORDER_2'] = 'ASC';
            }

            $fields = [
                $this->arParams['SORT_BY_1'] => $this->arParams['SORT_ORDER_1'],
                $this->arParams['SORT_BY_2'] => $this->arParams['SORT_ORDER_2'],
            ];

            if (is_array ($additionalFields) && !empty($additionalFields))
            {
                $fields = array_merge ($fields, $additionalFields);
            }

            return $fields;
        }
public function getParamsSort ( $ additionalFields = [ ] ) { $ this -> arParams [ 'SORT_BY_1' ] = trim ( $ this -> arParams [ 'SORT_BY_1' ] ) ; if ( strlen ( $ this -> arParams [ 'SORT_BY_1' ] ) <= 0 ) { $ this -> arParams [ 'SORT_BY_1' ] = 'ACTIVE_FROM' ; } if ( ! preg_match ( '/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i' , $ this -> arParams [ 'SORT_ORDER_1' ] ) ) { $ this -> arParams [ 'SORT_ORDER_1' ] = 'DESC' ; } if ( strlen ( $ this -> arParams [ 'SORT_BY_2' ] ) <= 0 ) { $ this -> arParams [ 'SORT_BY_2' ] = 'SORT' ; } if ( ! preg_match ( '/^(asc|desc|nulls)(,asc|,desc|,nulls){0,1}$/i' , $ this -> arParams [ 'SORT_ORDER_2' ] ) ) { $ this -> arParams [ 'SORT_ORDER_2' ] = 'ASC' ; } $ fields = [ $ this -> arParams [ 'SORT_BY_1' ] => $ this -> arParams [ 'SORT_ORDER_1' ] , $ this -> arParams [ 'SORT_BY_2' ] => $ this -> arParams [ 'SORT_ORDER_2' ] , ] ; if ( is_array ( $ additionalFields ) && ! empty ( $ additionalFields ) ) { $ fields = array_merge ( $ fields , $ additionalFields ) ; } return $ fields ; }
Returns prepare parameters of sort of the component

@param array $additionalFields Additional fields for sorting

@return array
Returns prepare parameters of sort of the component