Guest User

Untitled

a guest
Jun 7th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. class user {
  2. try{
  3. function __construct() {
  4.  
  5.  
  6. }
  7. public function setAdmin($admin) {
  8. $this->admin = $admin;
  9. }
  10.  
  11. public function setEmail($email) {
  12. if(filter_var($email) == true){
  13. $this->email = $email;
  14. }
  15. else{
  16. throw new Exception('Din mail er ikke gyldig');
  17. }
  18. }
  19.  
  20. public function setPassword($password) {
  21. if(strlen($password) > 4){
  22. $this->password = $password;
  23.  
  24. }
  25. else {
  26.  
  27. throw new Exception('Dit password skal være over 4 bogstaver langt.');
  28.  
  29. }
  30. }
  31.  
  32. public function setUsername($username) {
  33. $this->username = $username;
  34. }
  35. }
  36. catch (Exception $e){
  37.  
  38. }
  39.  
  40. }
Add Comment
Please, Sign In to add comment