ソースを参照

Update Models\Stopwords

Visman 3 年 前
コミット
8cf3015fc0
2 ファイル変更13 行追加7 行削除
  1. 11 5
      app/Models/StopwordList/StopwordList.php
  2. 2 2
      app/config/main.dist.php

+ 11 - 5
app/Models/Stopwords/Model.php → app/Models/StopwordList/StopwordList.php

@@ -8,17 +8,23 @@
 
 declare(strict_types=1);
 
-namespace ForkBB\Models\Stopwords;
+namespace ForkBB\Models\StopwordList;
 
-use ForkBB\Models\Model as ParentModel;
+use ForkBB\Models\Model;
 use RuntimeException;
 
-class Model extends ParentModel
+class StopwordList extends Model
 {
+    /**
+     * Ключ модели для контейнера
+     * @var string
+     */
+    protected $cKey = 'StopwordList';
+
     /**
      * Загружает список игнорируемых при индексации слов из кеша/БД
      */
-    public function init(): Model
+    public function init(): StopwordList
     {
         $data = $this->c->Cache->get('stopwords');
         if (
@@ -61,7 +67,7 @@ class Model extends ParentModel
     /**
      * Регенерация кэша массива слов с возвращением результата
      */
-    protected function load(): Model
+    protected function load(): StopwordList
     {
         $id = $this->generateId();
 

+ 2 - 2
app/config/main.dist.php

@@ -137,7 +137,7 @@ return [
         'admins'        => '@AdminListModel:init',
         'smilies'       => '@SmileyListModel:init',
         'dbMap'         => '@DBMapModel:init',
-        'stopwords'     => '@StopwordsModel:init',
+        'stopwords'     => '@StopwordListModel:init',
         'forums'        => '@ForumManager:init',
         'topics'        => \ForkBB\Models\Topic\Manager::class,
         'posts'         => \ForkBB\Models\Post\Posts::class,
@@ -355,7 +355,7 @@ return [
 
         'DBMapModel'          => \ForkBB\Models\DBMap\DBMap::class,
 
-        'StopwordsModel'      => \ForkBB\Models\Stopwords\Model::class,
+        'StopwordListModel'      => \ForkBB\Models\StopwordList\StopwordList::class,
 
         'UserModel'                   => \ForkBB\Models\User\Model::class,
         'UserManagerLoad'             => \ForkBB\Models\User\Load::class,