protected function setSorts(Jory $jory): void
    {
        $sorts = $this->getArrayValue($this->joryArray, 'srt');

        if ($sorts) {
            foreach ($sorts as $sort) {
                $order = 'asc';
                if (substr($sort, 0, 1) === '-') {
                    $order = 'desc';
                    $sort = substr($sort, 1);
                }
                try {
                    $jory->addSort(new Sort($sort, $order));
                } catch (JoryException $e) {
                    // This exception cannot be thrown here because we checked the data.
                    // Use empty try/catch to prevent IDE suggesting we should use a @throws tag.
                }
            }
        }
    }
protected function setSorts(Jory $jory): void
    {
        $sorts = $this->getArrayValue($this->joryArray, 'srt');

        if ($sorts) {
            foreach ($sorts as $sort) {
                $order = 'asc';
                if (substr($sort, 0, 1) === '-') {
                    $order = 'desc';
                    $sort = substr($sort, 1);
                }
                try {
                    $jory->addSort(new Sort($sort, $order));
                } catch (JoryException $e) {
                    // This exception cannot be thrown here because we checked the data.
                    // Use empty try/catch to prevent IDE suggesting we should use a @throws tag.
                }
            }
        }
    }
protected function setSorts ( Jory $ jory ) : void { $ sorts = $ this -> getArrayValue ( $ this -> joryArray , 'srt' ) ; if ( $ sorts ) { foreach ( $ sorts as $ sort ) { $ order = 'asc' ; if ( substr ( $ sort , 0 , 1 ) === '-' ) { $ order = 'desc' ; $ sort = substr ( $ sort , 1 ) ; } try { $ jory -> addSort ( new Sort ( $ sort , $ order ) ) ; } catch ( JoryException $ e ) { // This exception cannot be thrown here because we checked the data. // Use empty try/catch to prevent IDE suggesting we should use a @throws tag. } } } }
Set the sorts on the jory object based on the given data in constructor.

@param Jory $jory
Set the sorts on the jory object based on the given data in constructor .