Update Models\AdminList

This commit is contained in:
Visman 2021-12-02 22:02:23 +07:00
parent eafa30ff9e
commit 3628bcf8e5

View file

@ -10,16 +10,22 @@ declare(strict_types=1);
namespace ForkBB\Models\AdminList;
use ForkBB\Models\Model as ParentModel;
use ForkBB\Models\Model;
use RuntimeException;
class Model extends ParentModel
class AdminList extends Model
{
/**
* Ключ модели для контейнера
* @var string
*/
protected $cKey = 'AdminList';
/**
* Загружает список id админов из кеша/БД
* Создает кеш
*/
public function init(): Model
public function init(): AdminList
{
$this->list = $this->c->Cache->get('admins');
@ -37,7 +43,7 @@ class Model extends ParentModel
/**
* Сбрасывает кеш списка id админов
*/
public function reset(): Model
public function reset(): AdminList
{
if (true !== $this->c->Cache->delete('admins')) {
throw new RuntimeException('Unable to remove key from cache - admins');