/** * Does this user exist? * * @param $user_id * * @return bool */ public function Exists($user_id) { if ($this->database->Exists($user_id) == false) { return false; } return true; }
/** * What we do on construct * * @param $user_id */ public function __construct($user_id) { /** * Create a new database connection */ $this->database = new DatabaseUser(); $this->session = new DatabaseSession(); /** * If this user does not exist */ if ($this->database->Exists($user_id) == false) { return; } /** * Set our user id */ $this->user_id = $user_id; /** * Gets our database data */ $this->user_database_data = $this->database->Select($user_id); }