attach (key, model) {
    if (!this.hasRelationship(key)) {
      throw Exception.forbiddenRelationship(key)
    }

    this._setRelationship(key, model)

    this._emit(Model.ATTACHED, { key, model: this, attached: model })

    return this
  }
/**
   * Attach a model to a relationship
   * @param key
   * @param model
   */
Attach a model to a relationship
@param key
@param model
Attach a model to a relationship @param key @param model
attach (key, model) {
    if (!this.hasRelationship(key)) {
      throw Exception.forbiddenRelationship(key)
    }
    this._setRelationship(key, model)
    this._emit(Model.ATTACHED, { key, model: this, attached: model })
    return this
  }
attach ( key , model ) { if ( ! this . hasRelationship ( key ) ) { throw Exception . forbiddenRelationship ( key ) } this . _setRelationship ( key , model ) this . _emit ( Model . ATTACHED , { key , model : this , attached : model } ) return this }
Attach a model to a relationship
 @param key
 @param model
Attach a model to a relationship @param key @param model