Time for action – Adding a user
Now, let's create the function to add a user. It will take the login and the password as parameters and will return the created object as follows:
public static function createUser(login : String, password : String) : hxBlog.User { var u = new hxBlog.User(); u.username = login; u.setPassword(password); u.insert(); return u; }