Added nick class to remove bunch of nick{1-7} functions

This commit is contained in:
lopar
2018-03-03 22:51:37 +02:00
parent 1522f20a7b
commit 1c8cdec3eb
8 changed files with 39 additions and 38 deletions

32
classes/users_row.php Normal file
View File

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