Advertisement
Guest User

Untitled

a guest
Oct 30th, 2014
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.82 KB | None | 0 0
  1. <?php
  2. class User
  3. {
  4. private $firstname;
  5. private $username;
  6. private $password;
  7. private $admin;
  8. private $msg;
  9.  
  10. function __construct($firstname ,$username, $password, $admin) {
  11. /*
  12.  
  13. יוצר משתמש על פי מספר פרמטרים .
  14.  
  15. */
  16. if(empty($firstname) || empty($username) || empty($password) || empty($admin)) {
  17. throw new Exception("One of the required parameters you sent are empty");
  18. }
  19.  
  20. else {
  21. $this->firstname = $firstname;
  22. $this->username = $username;
  23. $this->password = $password;
  24. $this->admin = $admin;
  25. $this->msg = 0;
  26. }
  27.  
  28. }
  29. function getUser()
  30. {
  31. return $this->username;
  32. }
  33. function getMsg()
  34. {
  35. return $this->msg;
  36. }
  37. function getPassword()
  38. {
  39. return $this->password;
  40. }
  41. function getName()
  42. {
  43. return $this->firstname;
  44. }
  45. }
  46. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement