src/util/DocumentSorter.php
public static function sortDocumentsByField($documents, $field, $order = 'ASC')
    {
        self::$orderByField = $field;
        self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
        usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
        if ($order === 'DESC') {
            return array_reverse($documents);
        }
        return $documents;
    }
public static function sortDocumentsByField($documents, $field, $order = 'ASC')
    {
        self::$orderByField = $field;
        self::$order = strtoupper($order) === 'ASC' ? 'ASC' : 'DESC';
        usort($documents, '\CloudControl\Cms\util\DocumentSorter::fieldCompare');
        if ($order === 'DESC') {
            return array_reverse($documents);
        }
        return $documents;
    }
public static function sortDocumentsByField ( $ documents , $ field , $ order = 'ASC' ) { self :: $ orderByField = $ field ; self :: $ order = strtoupper ( $ order ) === 'ASC' ? 'ASC' : 'DESC' ; usort ( $ documents , '\CloudControl\Cms\util\DocumentSorter::fieldCompare' ) ; if ( $ order === 'DESC' ) { return array_reverse ( $ documents ) ; } return $ documents ; }
Sorts an array of Document instances
@param array $documents
@param string $field
@param string $order
@return array
Sorts an array of Document instances