src/Seboettg/CiteProc/Style/Sort/Sort.php
public function sort(&$data)
    {
        if (is_array($data)) {
            $data = new DataList($data);
        }
        $dataToSort = $data->toArray();
        try {
            $data->replace($this->performSort(0, $dataToSort));
        } catch (CiteProcException $e) {
            //nothing to do, because $data is passed by referenced
        }
    }
public function sort(&$data)
    {
        if (is_array($data)) {
            $data = new DataList($data);
        }
        $dataToSort = $data->toArray();
        try {
            $data->replace($this->performSort(0, $dataToSort));
        } catch (CiteProcException $e) {
            //nothing to do, because $data is passed by referenced
        }
    }
public function sort ( & $ data ) { if ( is_array ( $ data ) ) { $ data = new DataList ( $ data ) ; } $ dataToSort = $ data -> toArray ( ) ; try { $ data -> replace ( $ this -> performSort ( 0 , $ dataToSort ) ) ; } catch ( CiteProcException $ e ) { //nothing to do, because $data is passed by referenced } }
Function in order to sort a set of csl items by one or multiple sort keys.
Sort keys are evaluated in sequence. A primary sort is performed on all items using the first sort key.
A secondary sort, using the second sort key, is applied to items sharing the first sort key value. A tertiary
sort, using the third sort key, is applied to items sharing the first and second sort key values. Sorting
continues until either the order of all items is fixed, or until the sort keys are exhausted. Items with an
empty sort key value are placed at the end of the sort, both for ascending and descending sorts.

@param DataList|array $data reference
Function in order to sort a set of csl items by one or multiple sort keys . Sort keys are evaluated in sequence . A primary sort is performed on all items using the first sort key . A secondary sort using the second sort key is applied to items sharing the first sort key value . A tertiary sort using the third sort key is applied to items sharing the first and second sort key values . Sorting continues until either the order of all items is fixed or until the sort keys are exhausted . Items with an empty sort key value are placed at the end of the sort both for ascending and descending sorts .