This repository has been archived on 2024-06-26. You can view files and clone it, but cannot push or open issues or pull requests.
sakura/_sakura/components/User.php
2015-08-19 01:29:45 +02:00

28 lines
571 B
PHP

<?php
/*
* Everything you'd ever need from a specific user
*/
namespace Sakura;
class User {
// User data
public $user = [];
private $ranks = [];
// Initialise the user
function __contruct($id) {
// Get the user database row
$this->user = Database::fetch('users', false, ['id' => [$id, '=']]);
// Decode the ranks json array
$ranks = json_decode($this->user['ranks'], true);
// Get the rows for all the ranks
$this->ranks[] = Database::fetch('ranks', false, ['id' => [$id, '=']]);
}
}