mirror of
https://github.com/pierre42100/ComunicAPI
synced 2025-06-19 08:35:18 +00:00
Created BaseUserModel
This commit is contained in:
31
classes/models/BaseUserModel.php
Normal file
31
classes/models/BaseUserModel.php
Normal file
@ -0,0 +1,31 @@
|
||||
<?php
|
||||
/**
|
||||
* Base user model that contains identification information
|
||||
* about the user
|
||||
*
|
||||
* @author Pierre HUBERT
|
||||
*/
|
||||
|
||||
class BaseUserModel {
|
||||
|
||||
//Private fields
|
||||
private $userID = 0;
|
||||
|
||||
//Set and get user ID
|
||||
public function set_id(int $id){
|
||||
$this->id = $id;
|
||||
}
|
||||
|
||||
public function get_id() : int {
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check wether this 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