mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 08:35:18 +00:00
Created BaseUserModel
This commit is contained in:
@ -5,10 +5,12 @@
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
class User {
|
||||
//This model requires the BaseUserModel to be loaded
|
||||
require_once __DIR__."/BaseUserModel.php";
|
||||
|
||||
class User extends BaseUserModel {
|
||||
|
||||
//Private fields
|
||||
private $id;
|
||||
private $firstName;
|
||||
private $lastName;
|
||||
private $publicPage;
|
||||
@ -16,26 +18,6 @@ class User {
|
||||
private $virtualDirectory;
|
||||
private $accountImageURL;
|
||||
|
||||
/**
|
||||
* Public constructor of this object
|
||||
*/
|
||||
public function __construct(){
|
||||
|
||||
//Set the user ID to 0 by default (invalid user)
|
||||
$this->set_id(0);
|
||||
|
||||
}
|
||||
|
||||
//Set and get user ID
|
||||
public function set_id(int $id){
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function get_id() : int {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
|
||||
//Set and get the first name of the user
|
||||
public function set_firstName(string $firstName){
|
||||
$this->firstName = $firstName;
|
||||
@ -96,13 +78,4 @@ class User {
|
||||
public function get_accountImageURL() : string {
|
||||
return $this->accountImageURL;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check wether is object is valid or not
|
||||
*
|
||||
* @return bool TRUE if this object is valid / FALSE else
|
||||
*/
|
||||
public function isValid() : bool {
|
||||
return $this->id > 0;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user