fromJSON(json) {
    var instance = json.id ? this._db.getReference(this._managedType.typeConstructor, json.id) : this.newInstance();
    var metadata = instance._metadata;
    metadata.setJson(json);
    metadata.setDirty();
    return instance;
  }
/**
   * Creates a new instance and sets the DatabaseObject to the given json
   * @param {json} json
   * @returns {T} instance
   */
Creates a new instance and sets the DatabaseObject to the given json
@param {json} json
@returns {T} instance
Creates a new instance and sets the DatabaseObject to the given json @param { json } json @returns { T } instance
fromJSON(json) {
    var instance = json.id ? this._db.getReference(this._managedType.typeConstructor, json.id) : this.newInstance();
    var metadata = instance._metadata;
    metadata.setJson(json);
    metadata.setDirty();
    return instance;
  }
fromJSON ( json ) { var instance = json . id ? this . _db . getReference ( this . _managedType . typeConstructor , json . id ) : this . newInstance ( ) ; var metadata = instance . _metadata ; metadata . setJson ( json ) ; metadata . setDirty ( ) ; return instance ; }
Creates a new instance and sets the DatabaseObject to the given json
 @param {json} json
 @returns {T} instance
Creates a new instance and sets the DatabaseObject to the given json @param { json } json @returns { T } instance