<?php
	require_once("mother_entity.php");
	
	class User extends Entity{
		private int $_id;
		private string $_name = '';
		private string $_firstname = '';
		private string $_pseudo = '';
		private string $_image = '';
		private string $_mail = '';
		private string $_pwd;
		private string $_phone = '';
		private string $_work = '';
		private string $_birth = '';
		private string $_location = '';
		private string $_description = '';
		private string $_account_creation = '';
		private int $_status;
		
		public function __construct(){
			$this->_prefix = 'user_';
		}
		
		public function getId():int{
			return $this->_id;
		}
		public function setId(int $id){
			$this->_id = $id;
		}
		
		public function getName():string{
			return $this->_name;
		}
		public function setName(string $name){
			$this->_name = $name;
		}
		
		public function getFirstname():string{
			return $this->_firstname;
		}
		public function setFirstname(string $firstname){
			$this->_firstname = $firstname;
		}
		
		public function getPseudo():string{
			return $this->_pseudo;
		}
		public function setPseudo(string $pseudo){
			$this->_pseudo = $pseudo;
		}
		
		public function getImage():string{
			return $this->_image;
		}
		public function setImage(string $image){
			$this->_image = $image;
		}
		
		public function getMail():string{
			return $this->_mail;
		}
		public function setMail(string $mail){
			$this->_mail = strtolower($mail);
		}
		
		public function getPwd():string{
			return $this->_pwd;
		}
		public function getPwdHash():string{
			return password_hash($this->_pwd, PASSWORD_DEFAULT);
		}
		public function setPwd(string $pwd){
			$this->_pwd = $pwd;
		}
		
		public function getPhone():string{
			return $this->_phone;
		}
		public function setPhone(string $phone){
			$this->_phone = $phone;
		}
		
		public function getWork():string{
			return $this->_work;
		}
		public function setWork(string $work){
			$this->_work = $work;
		}
		
		public function getBirth():string{
			return $this->_birth;
		}
		public function setBirth(string $birth){
			$this->_birth = $birth;
		}
		
		public function getLocation():string{
			return $this->_location;
		}
		public function setLocation(string $location){
			$this->_location = $location;
		}
		
		public function getDescription():string{
			return $this->_description;
		}
		public function setDescription(string $description){
			$this->_description = $description;
		}
		
		public function getAccountCreation():string{
			return $this->_account_creation;
		}
		public function setAccountCreation(string $account_creation){
			$this->_account_creation = $account_creation;
		}
		
		public function getStatus():int{
			return $this->_status;
		}
		public function setStatus(int $status){
			$this->_status = $status;
		}
	}
