30 lines
804 B
PHP
30 lines
804 B
PHP
|
<?php
|
|||
|
/**
|
|||
|
* Author: lopiu
|
|||
|
* Date: 05.07.2020
|
|||
|
* Time: 23:32
|
|||
|
*/
|
|||
|
|
|||
|
class EffectsModel
|
|||
|
{
|
|||
|
protected $DB;
|
|||
|
const EFFECT_HIDEUSERINFO = 5;
|
|||
|
public function __construct(int $user_id) {
|
|||
|
$this->DB = db::c()->query('SELECT * FROM effects WHERE owner_id = ?i', $user_id);
|
|||
|
throw new Exception('<div class="debug">Не могу подключиться к таблице effects!</div>');
|
|||
|
}
|
|||
|
|
|||
|
/**
|
|||
|
* Проверка обезличен ли персонаж.
|
|||
|
* @return int date() до конца эффекта или 0.
|
|||
|
*/
|
|||
|
public function getHideUserInfoStatus()
|
|||
|
{
|
|||
|
while ($row = $this->DB->fetch_object()) {
|
|||
|
if ($row->type == self::EFFECT_HIDEUSERINFO) {
|
|||
|
return $row->time;
|
|||
|
}
|
|||
|
}
|
|||
|
return 0;
|
|||
|
}
|
|||
|
}
|