2018-03-01 19:14:51 +00:00
|
|
|
<?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;
|
|
|
|
|
2018-03-01 19:14:51 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* 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-01 19:14:51 +00:00
|
|
|
}
|
|
|
|
|
2018-03-03 00:07:27 +00:00
|
|
|
|
2018-03-01 19:14:51 +00:00
|
|
|
/**
|
2018-03-03 00:07:27 +00:00
|
|
|
* @return array
|
2018-03-01 19:14:51 +00:00
|
|
|
*/
|
|
|
|
public function i()
|
|
|
|
{
|
2018-03-03 00:07:27 +00:00
|
|
|
return $this->user_id;
|
2018-03-01 19:14:51 +00:00
|
|
|
}
|
|
|
|
}
|