MS-Tropical/app/models/User.php

49 lines
1.1 KiB
PHP
Executable File

<?php
class User
{
private $Email;
private $Title;
private $UserID;
private $Avatar;
private $Gender;
private $Badges;
private $AboutMe;
private $WhatsUp;
private $Username;
private $BirthDay;
private $JoinDate;
private $PostCount;
private $UserTitle;
private $Reputation;
private $isVerified;
private $MemberLevel;
public function __construct($id)
{
$this->UserID = $id;
$result = Database::select('users', '*', 'WHERE id = :id', data: [':id' => $id]);
$User = $result->fetch();
$this->Username = $User['username'];
$this->Title = $User['title'];
$this->Email = $User['email'];
$this->Gender = $User['gender'];
$this->Badges = $User['badges'];
$this->AboutMe = $User['blurb'];
$this->WhatsUp = $User['status'];
$this->BirthDay = $User['bday'];
$this->JoinDate = $User['joindate'];
$this->PostCount = $User['posts'];
$this->Avatar = $User['avatar'];
$this->Reputation = $User['reputation'];
$this->MemberLevel = $User['mlevel'];
}
public function __get($what)
{
return property_exists($this, $what) ? $this->{$what} : null;
}
}