Browse Source

Update Models\Censorship

Visman 3 years ago
parent
commit
6d626ea84d
2 changed files with 11 additions and 5 deletions
  1. 10 4
      app/Models/Censorship/Censorship.php
  2. 1 1
      app/Models/Censorship/Save.php

+ 10 - 4
app/Models/Censorship/Model.php → app/Models/Censorship/Censorship.php

@@ -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');

+ 1 - 1
app/Models/Censorship/Save.php

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