mirror of
https://github.com/pierre42100/ComunicAPI
synced 2024-11-30 17:26:35 +00:00
31 lines
508 B
PHP
31 lines
508 B
PHP
|
<?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;
|
||
|
}
|
||
|
}
|