Update Models\Config

This commit is contained in:
Visman 2021-12-02 22:06:24 +07:00
parent 6d626ea84d
commit 698910330a
4 changed files with 12 additions and 6 deletions

View file

@ -13,13 +13,19 @@ namespace ForkBB\Models\Config;
use ForkBB\Models\DataModel;
use RuntimeException;
class Model extends DataModel
class Config extends DataModel
{
/**
* Ключ модели для контейнера
* @var string
*/
protected $cKey = 'Config';
/**
* Заполняет модель данными из кеша/БД
* Создает кеш
*/
public function init(): Model
public function init(): Config
{
$config = $this->c->Cache->get('config');
@ -39,7 +45,7 @@ class Model extends DataModel
/**
* Сбрасывает кеш конфига
*/
public function reset(): Model
public function reset(): Config
{
if (true !== $this->c->Cache->delete('config')) {
throw new RuntimeException('Unable to remove key from cache - config');

View file

@ -11,7 +11,7 @@ declare(strict_types=1);
namespace ForkBB\Models\Config;
use ForkBB\Models\Method;
use ForkBB\Models\Config\Model as Config;
use ForkBB\Models\Config\Config;
class Install extends Method
{

View file

@ -11,7 +11,7 @@ declare(strict_types=1);
namespace ForkBB\Models\Config;
use ForkBB\Models\Method;
use ForkBB\Models\Config\Model as Config;
use ForkBB\Models\Config\Config;
use PDO;
use RuntimeException;

View file

@ -11,7 +11,7 @@ declare(strict_types=1);
namespace ForkBB\Models\Config;
use ForkBB\Models\Method;
use ForkBB\Models\Config\Model as Config;
use ForkBB\Models\Config\Config;
class Save extends Method
{