2018-04-15 10:35:00 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* User model
|
|
|
|
*
|
|
|
|
* @author Pierre HUBERT
|
|
|
|
*/
|
|
|
|
|
2018-04-19 07:40:15 +00:00
|
|
|
//This model requires the BaseUserModel to be loaded
|
|
|
|
require_once __DIR__."/BaseUserModel.php";
|
|
|
|
|
|
|
|
class User extends BaseUserModel {
|
2018-04-15 10:35:00 +00:00
|
|
|
|
|
|
|
//Private fields
|
|
|
|
private $firstName;
|
|
|
|
private $lastName;
|
|
|
|
private $publicPage;
|
|
|
|
private $openPage;
|
|
|
|
private $virtualDirectory;
|
|
|
|
private $accountImageURL;
|
|
|
|
|
|
|
|
//Set and get the first name of the user
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_firstName(string $firstName){
|
2018-04-15 10:35:00 +00:00
|
|
|
$this->firstName = $firstName;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function get_firstName() : string {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->firstName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Set and get the last name of the user
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_lastName(string $lastName){
|
2018-04-15 10:35:00 +00:00
|
|
|
$this->lastName = $lastName;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function get_lastName() : string {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->lastName;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Set and get the public status of the user page
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_publicPage(bool $publicPage){
|
2018-04-15 10:35:00 +00:00
|
|
|
$this->publicPage = $publicPage;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function is_publicPage() : bool {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->publicPage;
|
|
|
|
}
|
|
|
|
|
|
|
|
//Set and get the open status of the user page
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_openPage(bool $openPage){
|
2018-04-15 10:35:00 +00:00
|
|
|
$this->openPage = $openPage;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function is_openPage() : bool {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->openPage;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//Set and get the virtual directory of the user
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_virtualDirectory(string $virtualDirectory){
|
|
|
|
$this->virtualDirectory = $virtualDirectory == "" ? null : $virtualDirectory;
|
2018-04-15 10:35:00 +00:00
|
|
|
}
|
|
|
|
|
2018-04-15 12:26:26 +00:00
|
|
|
public function has_virtualDirectory() : bool {
|
|
|
|
return $this->virtualDirectory != null;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function get_virtualDirectory() : string {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->virtualDirectory != null ? $this->virtualDirectory : "null";
|
|
|
|
}
|
|
|
|
|
|
|
|
//Set and get the URL pointing of the user account image
|
2018-04-15 11:55:51 +00:00
|
|
|
public function set_accountImageURL(string $accountImageURL){
|
2018-04-15 10:35:00 +00:00
|
|
|
$this->accountImageURL = $accountImageURL;
|
|
|
|
}
|
|
|
|
|
2018-04-15 11:55:51 +00:00
|
|
|
public function get_accountImageURL() : string {
|
2018-04-15 10:35:00 +00:00
|
|
|
return $this->accountImageURL;
|
|
|
|
}
|
|
|
|
}
|