Swat/SwatHtmlHeadEntrySetDisplayer.php
protected function getSortedEntries(array $original_entries)
    {
        $entries = array();

        // get array of entries with native ordering so we can do a
        // stable, user-defined sort
        $count = 0;
        foreach ($original_entries as $uri => $entry) {
            $entries[] = array(
                'order' => $count,
                'uri' => $uri,
                'object' => $entry
            );
            $count++;
        }

        // stable-sort entries
        usort($entries, array($this, 'compareEntries'));

        // put back in a flat array
        $sorted_entries = array();
        foreach ($entries as $uri => $entry) {
            $sorted_entries[$uri] = $entry['object'];
        }

        return $sorted_entries;
    }
protected function getSortedEntries(array $original_entries)
    {
        $entries = array();

        // get array of entries with native ordering so we can do a
        // stable, user-defined sort
        $count = 0;
        foreach ($original_entries as $uri => $entry) {
            $entries[] = array(
                'order' => $count,
                'uri' => $uri,
                'object' => $entry
            );
            $count++;
        }

        // stable-sort entries
        usort($entries, array($this, 'compareEntries'));

        // put back in a flat array
        $sorted_entries = array();
        foreach ($entries as $uri => $entry) {
            $sorted_entries[$uri] = $entry['object'];
        }

        return $sorted_entries;
    }
protected function getSortedEntries ( array $ original_entries ) { $ entries = array ( ) ; // get array of entries with native ordering so we can do a // stable, user-defined sort $ count = 0 ; foreach ( $ original_entries as $ uri => $ entry ) { $ entries [ ] = array ( 'order' => $ count , 'uri' => $ uri , 'object' => $ entry ) ; $ count ++ ; } // stable-sort entries usort ( $ entries , array ( $ this , 'compareEntries' ) ) ; // put back in a flat array $ sorted_entries = array ( ) ; foreach ( $ entries as $ uri => $ entry ) { $ sorted_entries [ $ uri ] = $ entry [ 'object' ] ; } return $ sorted_entries ; }
Gets the entries of this set sorted by their correct display order

@param array $original_entries

@return array the entries of this set sorted by their correct display
order.
Gets the entries of this set sorted by their correct display order