public function saveUser($passedUsername = "", $passedPassword = "") { /* *Empty email model to create and commit *New comments wont have an id or a timestamp, database handles that */ $userModel = new User_model(); /* *TODO: move all the set methods into the constructor of the model *TODO: find more elegant solution than hard coding sets *TODO: add error checking to the commit method */ $userModel->setUsername($passedUsername); /* * Save password as hash so increase security */ $userModel->setPassword(hash("sha256", $passedPassword)); /* * Commit the model to the database and send result back */ return $userModel->commit(); }