File tree Expand file tree Collapse file tree 2 files changed +8
-8
lines changed
Model/ResourceModel/Indexer
Test/Unit/Model/ResourceModel/Indexer Expand file tree Collapse file tree 2 files changed +8
-8
lines changed Original file line number Diff line number Diff line change 10
10
*/
11
11
class ActiveTableSwitcher
12
12
{
13
- /** Suffix for outdated index table. */
14
- const OUTDATED_TABLE_SUFFIX = '_outdated ' ;
15
-
16
13
/** Suffix for replica index table. */
17
- const ADDITIONAL_TABLE_SUFFIX = '_replica ' ;
14
+ private $ additionalTableSuffix = '_replica ' ;
15
+
16
+ /** Suffix for outdated index table. */
17
+ private $ outdatedTableSuffix = '_outdated ' ;
18
18
19
19
/**
20
20
* Switch index tables from replica to active.
@@ -25,8 +25,8 @@ class ActiveTableSwitcher
25
25
*/
26
26
public function switchTable (\Magento \Framework \DB \Adapter \AdapterInterface $ connection , $ tableName )
27
27
{
28
- $ outdatedTableName = $ tableName . self :: OUTDATED_TABLE_SUFFIX ;
29
- $ replicaTableName = $ tableName . self :: ADDITIONAL_TABLE_SUFFIX ;
28
+ $ outdatedTableName = $ tableName . $ this -> outdatedTableSuffix ;
29
+ $ replicaTableName = $ tableName . $ this -> additionalTableSuffix ;
30
30
31
31
$ connection ->renameTablesBatch (
32
32
[
@@ -52,6 +52,6 @@ public function switchTable(\Magento\Framework\DB\Adapter\AdapterInterface $conn
52
52
*/
53
53
public function getAdditionalTableName ($ tableName )
54
54
{
55
- return $ tableName . self :: ADDITIONAL_TABLE_SUFFIX ;
55
+ return $ tableName . $ this -> additionalTableSuffix ;
56
56
}
57
57
}
Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ public function testGetAdditionalTableName()
49
49
{
50
50
$ tableName = 'table_name ' ;
51
51
$ this ->assertEquals (
52
- $ tableName . \ Magento \ Catalog \ Model \ ResourceModel \ Indexer \ActiveTableSwitcher:: ADDITIONAL_TABLE_SUFFIX ,
52
+ $ tableName . ' _replica ' ,
53
53
$ this ->model ->getAdditionalTableName ($ tableName )
54
54
);
55
55
}
You can’t perform that action at this time.
0 commit comments