Add reset() method for BanList
This commit is contained in:
parent
de3df36af6
commit
a333387636
3 changed files with 14 additions and 2 deletions
|
@ -24,7 +24,7 @@ class Delete extends Method
|
|||
WHERE id IN (?ai:ids)';
|
||||
|
||||
$this->c->DB->exec($query, $vars);
|
||||
$this->model->load();
|
||||
$this->model->reset();
|
||||
}
|
||||
|
||||
return $this->model;
|
||||
|
|
|
@ -76,4 +76,16 @@ class Model extends ParentModel
|
|||
return (isset($bin[4]) ? '' : '-') . \bin2hex($bin);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Сбрасывает кеш банов
|
||||
*/
|
||||
public function reset(): Model
|
||||
{
|
||||
if (true !== $this->c->Cache->delete('banlist')) {
|
||||
throw new RuntimeException('Unable to remove key from cache - banlist');
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -677,7 +677,7 @@ class Bans extends Admin
|
|||
]);
|
||||
}
|
||||
|
||||
$this->c->bans->load();
|
||||
$this->c->bans->reset();
|
||||
|
||||
$redirect = $this->c->Redirect;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue