Advertisement
Guest User

Untitled

a guest
Feb 19th, 2019
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.91 KB | None | 0 0
  1. UploadCLASS
  2.  
  3.             //HÄMTA USER I EN ICKE-INSTANS SÅ JA FÅR REDA PÅ ROLE genom getRole()????
  4.             \Model\User $user ...??
  5.  
  6.             if($comViw->WantComment())
  7.             {
  8.                 $newsID = $fileViw->GetSelectedID();
  9.                 $body .= $fileViw->doOutputArticles($fileHandlr->GetAllNews(), $fileHandlr->GetAllPictures(), $newsID, $Role); 
  10.                 $body .= $comContrl->doControll($db, $newsID);
  11.             }
  12.             else
  13.             {
  14.                 $body .= $fileViw->doOutputArticles($fileHandlr->GetAllNews(), $fileHandlr->GetAllPictures(), $newsID = NULL, $Role);
  15.             }
  16.            
  17.             return $fileViw->doOutput($body, $message);
  18.  
  19. -------------------------------------------
  20.  
  21. User CLASS
  22.  
  23. <?php
  24. namespace Model;
  25.  
  26.     class UserArray
  27.     {
  28.             private $_Users = array();
  29.            
  30.             public function __construct() {
  31.                    
  32.             }
  33.             public function add(User $Users)
  34.             {
  35.                     $this->_Users[] = $Users;
  36.             }
  37.             public function get()
  38.             {
  39.                     return $this->_Users;
  40.             }
  41.     }
  42.  
  43.     class User
  44.     {
  45.             private $_UserID; //Integer
  46.             private $_Username; //String
  47.             private $_Password; //String
  48.             private $_Role; //String
  49.            
  50.             public function __construct($UserID, $Username, $Password, $Role)
  51.             {
  52.                 $this->_UserID = $UserID;
  53.                 $this->_Username = $Username;
  54.                 $this->_Password = $Password;
  55.                 $this->_Role = $Role;
  56.             }
  57.            
  58.             public function getUserID()
  59.             {
  60.                 return $this->_UserID;
  61.             }
  62.            
  63.             public function getUsername()
  64.             {
  65.                 return $this->_Username;
  66.             }
  67.            
  68.             public function getPassword()
  69.             {
  70.                 return $this->_Password;                  
  71.             }
  72.            
  73.             public function getRole()
  74.             {
  75.                 return $this->_Role;                  
  76.             }
  77.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement