build/rekord.js
function(models, remoteData)
  {
    var map = this.map;

    map.reset();

    if ( isArray( models ) )
    {
      for (var i = 0; i < models.length; i++)
      {
        var model = models[ i ];
        var parsed = this.parseModel( model, remoteData );

        if ( parsed )
        {
          map.put( parsed.$key(), parsed );
        }
      }
    }
    else if ( isObject( models ) )
    {
      var parsed = this.parseModel( models, remoteData );

      if ( parsed )
      {
        map.put( parsed.$key(), parsed );
      }
    }

    this.trigger( Collection.Events.Reset, [this] );
    this.sort();

    return this;
  }
function(models, remoteData)
  {
    var map = this.map;

    map.reset();

    if ( isArray( models ) )
    {
      for (var i = 0; i < models.length; i++)
      {
        var model = models[ i ];
        var parsed = this.parseModel( model, remoteData );

        if ( parsed )
        {
          map.put( parsed.$key(), parsed );
        }
      }
    }
    else if ( isObject( models ) )
    {
      var parsed = this.parseModel( models, remoteData );

      if ( parsed )
      {
        map.put( parsed.$key(), parsed );
      }
    }

    this.trigger( Collection.Events.Reset, [this] );
    this.sort();

    return this;
  }
function ( models , remoteData ) { var map = this . map ; map . reset ( ) ; if ( isArray ( models ) ) { for ( var i = 0 ; i < models . length ; i ++ ) { var model = models [ i ] ; var parsed = this . parseModel ( model , remoteData ) ; if ( parsed ) { map . put ( parsed . $key ( ) , parsed ) ; } } } else if ( isObject ( models ) ) { var parsed = this . parseModel ( models , remoteData ) ; if ( parsed ) { map . put ( parsed . $key ( ) , parsed ) ; } } this . trigger ( Collection . Events . Reset , [ this ] ) ; this . sort ( ) ; return this ; }
Resets the models in this collection with a new collection of models.

@method
@memberof Rekord.ModelCollection#
@param {modelInput[]} [models] -
The initial array of models in this collection.
@param {Boolean} [remoteData=false] -
If the models array is from a remote source. Remote sources place the
model directly into the database while local sources aren't stored in the
database until they're saved.
@return {Rekord.ModelCollection} -
The reference to this collection.
@see Rekord.ModelCollection#parseModel
@emits Rekord.ModelCollection#reset
Resets the models in this collection with a new collection of models .