From 06bd098d2f9835ca0fa739cea3dad426ffd7dd45 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 15 Apr 2018 12:35:00 +0200 Subject: [PATCH] Created user object --- classes/components/user.php | 4 +- classes/models/User.php | 86 +++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 2 deletions(-) create mode 100644 classes/models/User.php diff --git a/classes/components/user.php b/classes/components/user.php index b5797b4..1ea5851 100644 --- a/classes/components/user.php +++ b/classes/components/user.php @@ -5,7 +5,7 @@ * @author Pierre HUBERT */ -class User{ +class UserComponent { /** * @var String $userTable The name of the user table @@ -388,4 +388,4 @@ class User{ } //Register class -Components::register("user", new User()); \ No newline at end of file +Components::register("user", new UserComponent()); \ No newline at end of file diff --git a/classes/models/User.php b/classes/models/User.php new file mode 100644 index 0000000..c2dd1bc --- /dev/null +++ b/classes/models/User.php @@ -0,0 +1,86 @@ +id = $id; + } + + private function get_id() : int { + return $this->id; + } + + + //Set and get the first name of the user + private function set_firstName(string $firstName){ + $this->firstName = $firstName; + } + + private function get_firstName() : string { + return $this->firstName; + } + + + //Set and get the last name of the user + private function set_lastName(string $lastName){ + $this->lastName = $lastName; + } + + private function get_lastName() : string { + return $this->lastName; + } + + + //Set and get the public status of the user page + private function set_publicPage(bool $publicPage){ + $this->publicPage = $publicPage; + } + + private function is_publicPage() : bool { + return $this->publicPage; + } + + //Set and get the open status of the user page + private function set_openPage(bool $openPage){ + $this->openPage = $openPage; + } + + private function is_openPage() : bool { + return $this->openPage; + } + + + //Set and get the virtual directory of the user + private function set_virtualDirectory(string $virtualDirectory){ + $this->virtualDirectory = $virtualDirectory; + } + + private function get_virtualDirectory() : string { + return $this->virtualDirectory != null ? $this->virtualDirectory : "null"; + } + + //Set and get the URL pointing of the user account image + private function set_accountImageURL(string $accountImageURL){ + $this->accountImageURL = $accountImageURL; + } + + private function get_accountImageURL() : string { + return $this->accountImageURL; + } +} \ No newline at end of file