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;
    }