nl_tokens: Bind events and setup collectionKeys for a collection that is to be used as the backing store for a HasMany . If no collection is supplied a new collection will be created of the specified collectionType option .
pl_tokens: function ( collection ) { if ( this . related ) { this . stopListening ( this . related ) ; } if ( ! collection || ! ( collection instanceof Backbone . Collection ) ) { var options = _ . isFunction ( this . options . collectionOptions ) ? this . options . collectionOptions ( this . instance ) : this . options . collectionOptions ; collection = new this . collectionType ( null , options ) ; } collection . model = this . relatedModel ; if ( this . options . collectionKey ) { var key = this . options . collectionKey === true ? this . <mask> . reverseRelation . key : this . options . collectionKey ; if ( collection [ key ] && collection [ key ] !== this . instance ) { if ( Backbone . Relational . showWarnings && typeof console !== 'undefined' ) { console . warn ( 'Relation=%o; collectionKey=%s already exists on collection=%o' , this , key , this . options . collectionKey ) ; } } else if ( key ) { collection [ key ] = this . instance ; } } this . listenTo ( collection , 'relational:add' , this . handleAddition ) . listenTo ( collection , 'relational:remove' , this . handleRemoval ) . listenTo ( collection , 'relational:reset' , this . handleReset ) ; return collection ; }