Skip to content

Commit 3456dcc

Browse files
committed
Remove categoryPrefix from tables.
1 parent 468133b commit 3456dcc

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

Module.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,6 @@
4949
* 'table' => '{{%language}}', // table name
5050
* 'columns' => ['name', 'name_ascii'], //names of multilingual fields
5151
* 'category' => 'database-table-name', // the category is the database table name
52-
* 'categoryPrefix' => 'lx-'
5352
* ]
5453
* ]
5554
* ],

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,6 @@ A more complex example including database table with multilingual support is bel
112112
'table' => '{{%language}}', // table name
113113
'columns' => ['name', 'name_ascii'],// names of multilingual fields
114114
'category' => 'database-table-name',// the category is the database table name
115-
'categoryPrefix' => 'lx-' //
116115
]
117116
]
118117
],
@@ -311,6 +310,10 @@ class Category extends \yii\db\ActiveRecord {
311310
Language::saveMessage($this->name);
312311
Language::saveMessage($this->description);
313312

313+
// or If the category is the database table name.
314+
// Language::saveMessage($this->name, static::tableName());
315+
// Language::saveMessage($this->description, static::tableName());
316+
314317
return true;
315318
}
316319

services/scanners/ScannerDatabase.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
* 'table' => '{{%language}}',
2020
* 'columns' => ['name', 'name_ascii'],
2121
* 'category' => 'database-table-name',
22-
* 'categoryPrefix' => 'lx-'
2322
* ],
2423
* [
2524
* 'connection' => 'db',
@@ -106,8 +105,7 @@ private function _scanningTable($tables) {
106105
*/
107106
private function _getCategory($tables) {
108107
if (isset($tables['category']) && $tables['category'] == 'database-table-name') {
109-
$tableName = $this->_normalizeTablename($tables['table']);
110-
$category = (isset($tables['categoryPrefix'])) ? $tables['categoryPrefix'] . $tableName : $tableName;
108+
$category = $this->_normalizeTablename($tables['table']);
111109
} else {
112110
$category = Scanner::CATEGORY_DATABASE;
113111
}

0 commit comments

Comments
 (0)