Будь проклят тот день, когда я решил ввести неймспейсы...

This commit is contained in:
lopar
2020-10-28 22:21:08 +02:00
parent f1b9ce6a45
commit d38d62c5b5
159 changed files with 339 additions and 304 deletions
+33
View File
@@ -0,0 +1,33 @@
<?php
/**
* Author: lopiu
* Date: 04.07.2020
* Time: 13:17
*/
namespace Battles\Models;
use Exceptions\GameException;
class PresentsModel
{
protected $DB;
public function __construct(int $user_id)
{
if (!$this->DB) {
$this->DB = \db::c()->query('SELECT sender_id, image FROM `users_presents` WHERE owner_id = ?i', $user_id);
if ($this->DB->getNumRows() == 0) {
throw new GameException("<div class='debug'>class PresentsModel: Не прогрузилась база!</div>");
}
}
}
public function getAllPresents()
{
return $this->DB;
}
public function getPresentsSum()
{
return $this->DB->getNumRows();
}
}