@@ -14,6 +14,7 @@ class Check
|
||||
* Check constructor.
|
||||
*
|
||||
* @param User $user
|
||||
* @param Db $db
|
||||
*/
|
||||
public function __construct(User $user, Db $db)
|
||||
{
|
||||
@@ -21,8 +22,13 @@ class Check
|
||||
$this->db = $db;
|
||||
}
|
||||
|
||||
public function Effects()
|
||||
public static function expiredEffects()
|
||||
{
|
||||
return $this->db->execute('delete from users_effects where remaining_time <= ?', strtotime('now'));
|
||||
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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user