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

29 lines
571 B
PHP
Raw Normal View History

2015-08-18 23:29:45 +00:00
<?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, '=']]);
}
}