register(user, password, loginOption, doneCallback, failCallback) {
    if (loginOption instanceof Function) {
      failCallback = doneCallback;
      doneCallback = loginOption;
      loginOption = true;
    }

    user = Object(user) instanceof String? this.fromJSON({username: user}): user;
    return this._db.register(user, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
  }
/**
   * Register a new user with the given username and password, if the username is not used by an another user.
   * @param {string|model.User} user The username as a string or a <User> Object, which must contain the username.
   * @param {string} password The password for the given user
   * @param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions
   * @param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
   * @param {binding.Entity~failCallback=} failCallback Called when the operation failed.
   * @return {Promise<model.User>} The created user object, for the new registered user.
   */
Register a new user with the given username and password, if the username is not used by an another user.
@param {string|model.User} user The username as a string or a  Object, which must contain the username.
@param {string} password The password for the given user
@param {boolean|binding.UserFactory.LoginOption} [loginOption=true] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions
@param {binding.Entity~doneCallback=} doneCallback Called when the operation succeed.
@param {binding.Entity~failCallback=} failCallback Called when the operation failed.
@return {Promise} The created user object, for the new registered user.
Register a new user with the given username and password if the username is not used by an another user . @param { string|model . User } user The username as a string or a Object which must contain the username . @param { string } password The password for the given user @param { boolean|binding . UserFactory . LoginOption } [ loginOption = true ] The default logs the user in after a successful registration and keeps the user logged in over multiple sessions @param { binding . Entity~doneCallback = } doneCallback Called when the operation succeed . @param { binding . Entity~failCallback = } failCallback Called when the operation failed . @return { Promise } The created user object for the new registered user .
register(user, password, loginOption, doneCallback, failCallback) {
    if (loginOption instanceof Function) {
      failCallback = doneCallback;
      doneCallback = loginOption;
      loginOption = true;
    }
    user = Object(user) instanceof String? this.fromJSON({username: user}): user;
    return this._db.register(user, password, loginOption === undefined? true: loginOption).then(doneCallback, failCallback);
  }
register ( user , password , loginOption , doneCallback , failCallback ) { if ( loginOption instanceof Function ) { failCallback = doneCallback ; doneCallback = loginOption ; loginOption = true ; } user = Object ( user ) instanceof String ? this . fromJSON ( { username : user } ) : user ; return this . _db . register ( user , password , loginOption === undefined ? true : loginOption ) . then ( doneCallback , failCallback ) ; }
Register a new user with the given username and password, if the username is not used by an another user.
Register a new user with the given username and password if the username is not used by an another user .