battles/classes/Battles/Check.php

35 lines
690 B
PHP
Raw Permalink Normal View History

<?php
# Date: 15.03.2021 (21:53)
namespace Battles;
use Battles\Database\Db;
class Check
{
private User $user;
private Db $db;
/**
* Check constructor.
*
* @param User $user
* @param Db $db
*/
public function __construct(User $user, Db $db)
{
$this->user = $user;
$this->db = $db;
}
public static function expiredEffects()
{
return Db::getInstance()->execute('delete from users_effects where remaining_time <= ?', strtotime('now'));
}
public static function userExists($id): bool
{
return Db::getInstance()->fetchColumn('select count(*) from users where id = ?', $id) > 0;
}
2022-12-16 23:20:43 +00:00
}