csscomb::set_sort_order PHP Method

set_sort_order() public method

Функция устанавливает $this->sort_order
public set_sort_order ( $json_array = null )
    function set_sort_order($json_array = null)
    {
        $this->sort_order = json_decode($this->default_sort_order);
        if ($json_array !== null) {
            $custom_sort_order = json_decode($json_array);
            if (is_array($custom_sort_order) and count($custom_sort_order) > 0) {
                $this->sort_order = $custom_sort_order;
            }
        }
        if ($json_array === 'yandex') {
            $this->sort_order = json_decode($this->yandex_sort_order);
            //switch(json_last_error()) {
            //case JSON_ERROR_DEPTH:
            //echo 'JSON parse error: Достигнута максимальная глубина стека';
            //break;
            //case JSON_ERROR_STATE_MISMATCH:
            //echo 'JSON parse error: Некорректные разряды или не совпадение режимов';
            //break;
            //case JSON_ERROR_CTRL_CHAR:
            //echo 'JSON parse error: Некорректный управляющий символ';
            //break;
            //case JSON_ERROR_SYNTAX:
            //echo 'JSON parse error: Синтаксическая ошибка, не корректный JSON';
            //break;
            //}
        }
    }