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