js/data/Collection.js
function (query) {
            if (query instanceof Query && query.query.sort) {
                if (this.$.query) {
                    query.query.where = this.$.query.query.where;
                }


                var options = _.defaults({}, {
                    query: query,
                    root: this.getRoot()
                }, this.$);

                var sortCacheId = query.sortCacheId();

                if (!this.$sortCache[sortCacheId]) {
                    this.$sortCache[sortCacheId] = this._createSortedCollection(query, options);
                }

                return this.$sortCache[sortCacheId];
            }

            return this;
        }
function (query) {
            if (query instanceof Query && query.query.sort) {
                if (this.$.query) {
                    query.query.where = this.$.query.query.where;
                }


                var options = _.defaults({}, {
                    query: query,
                    root: this.getRoot()
                }, this.$);

                var sortCacheId = query.sortCacheId();

                if (!this.$sortCache[sortCacheId]) {
                    this.$sortCache[sortCacheId] = this._createSortedCollection(query, options);
                }

                return this.$sortCache[sortCacheId];
            }

            return this;
        }
function ( query ) { if ( query instanceof Query && query . query . sort ) { if ( this . $ . query ) { query . query . where = this . $ . query . query . where ; } var options = _ . defaults ( { } , { query : query , root : this . getRoot ( ) } , this . $ ) ; var sortCacheId = query . sortCacheId ( ) ; if ( ! this . $sortCache [ sortCacheId ] ) { this . $sortCache [ sortCacheId ] = this . _createSortedCollection ( query , options ) ; } return this . $sortCache [ sortCacheId ] ; } return this ; }
Returns a sorted query collection

@param {js.data.Query} query
@returns {js.data.Collection}
Returns a sorted query collection