battles/classes/u.php

33 lines
526 B
PHP
Raw Normal View History

<?php
/**
* Copyright (c) 2018.
* Author: Igor Barkov <lopar.4ever@gmail.com>
* Project name: Battles-Game
*/
class u
{
2018-03-03 00:07:27 +00:00
private $user_id;
/**
* u constructor.
* @param $playerId
*/
public function __construct($playerId)
{
2018-03-03 00:07:27 +00:00
if (!$this->user_id) {
$this->user_id = db::c()->query('SELECT * FROM `users` WHERE `id` = ?i',$playerId)->fetch_assoc();
}
}
2018-03-03 00:07:27 +00:00
/**
2018-03-03 00:07:27 +00:00
* @return array
*/
public function i()
{
2018-03-03 00:07:27 +00:00
return $this->user_id;
}
}