From 375a4c6c829b5585e0f788cf247befb15ea66d49 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sat, 3 Feb 2018 15:17:25 +0100 Subject: [PATCH] Created friend model --- classes/models/Friend.php | 47 +++++++++++++++++++++++++++++++++++++++ init.php | 5 +++++ 2 files changed, 52 insertions(+) create mode 100644 classes/models/Friend.php diff --git a/classes/models/Friend.php b/classes/models/Friend.php new file mode 100644 index 0000000..5bc4b72 --- /dev/null +++ b/classes/models/Friend.php @@ -0,0 +1,47 @@ +friendID = $id; + } + public function getFriendID() : int { + return $this->friendID; + } + + //Set and get the accepted state of the friendship + public function setAccepted(bool $accepted){ + $this->accepted = $accepted; + } + public function isAccepted() : bool { + return $this->accepted; + } + + //Set and get the following state of the friendship + public function setFollowing(bool $following){ + $this->following = $following; + } + public function isFollowing() : bool { + return $this->following; + } + + //Set and get the last activity time of the friend + public function setLastActivityTime(int $time){ + $this->last_activity_time = $time; + } + public function getLastActivityTime() : int { + return $this->last_activity_time; + } +} \ No newline at end of file diff --git a/init.php b/init.php index e5fa7a5..8a59ded 100644 --- a/init.php +++ b/init.php @@ -51,6 +51,11 @@ $tokens = new Tokens(); $cs->register("tokens", $tokens); unset($tokens); +//Include models +foreach(glob(PROJECT_PATH."classes/models/*.php") as $classFile){ + require_once $classFile; +} + //Include components foreach(glob(PROJECT_PATH."classes/components/*.php") as $classFile){ require_once $classFile;