nl_tokens: Find an instance of this type in Backbone . Relational . store . - If attributes is a string or a number findOrCreate will just query the store and return a model if found . - If attributes is an object and is found in the store the model will be updated with attributes unless options . update is false . Otherwise a new model is created with attributes ( unless options . create is explicitly set to false ) .
pl_tokens: function ( attributes , options ) { options || ( options = { } ) ; var parsedAttributes = ( _ . isObject ( attributes ) && options . parse && this . prototype . parse ) ? this . prototype . parse ( _ . clone ( attributes ) ) : attributes ; // Try to find an instance of 'this' model type in the store var model = Backbone . Relational . store . find ( this , parsedAttributes ) ; // If we found an instance, update it with the data in 'item' (unless 'options.merge' is false). // If not, create an instance (unless 'options.create' is false). if ( _ . isObject ( attributes ) ) { if ( model && options . merge !== false ) { // Make sure `options.collection` and `options.url` doesn't cascade to nested models <mask> options . collection ; delete options . url ; model . set ( parsedAttributes , options ) ; } else if ( ! model && options . create !== false ) { model = this . build ( attributes , options ) ; } } return model ; }