forkbb/app/Models/Config/Model.php
2020-10-14 21:46:49 +07:00

26 lines
465 B
PHP

<?php
declare(strict_types=1);
namespace ForkBB\Models\Config;
use ForkBB\Models\DataModel;
class Model extends DataModel
{
/**
* Заполняет модель данными из кеша/БД
*/
public function init(): Model
{
$config = $this->c->Cache->get('config');
if (\is_array($config)) {
$this->setAttrs($config);
} else {
$this->load();
}
return $this;
}
}