Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class user {
- try{
- function __construct() {
- }
- public function setAdmin($admin) {
- $this->admin = $admin;
- }
- public function setEmail($email) {
- if(filter_var($email) == true){
- $this->email = $email;
- }
- else{
- throw new Exception('Din mail er ikke gyldig');
- }
- }
- public function setPassword($password) {
- if(strlen($password) > 4){
- $this->password = $password;
- }
- else {
- throw new Exception('Dit password skal være over 4 bogstaver langt.');
- }
- }
- public function setUsername($username) {
- $this->username = $username;
- }
- }
- catch (Exception $e){
- }
- }
Add Comment
Please, Sign In to add comment