Commit 4d4a3f08 by Sorokin Victor

Update MessageController.php

parent eba9049b
...@@ -134,14 +134,14 @@ class MessageController extends Controller ...@@ -134,14 +134,14 @@ class MessageController extends Controller
throw new Exception('The "db" option must refer to a valid database application component.'); throw new Exception('The "db" option must refer to a valid database application component.');
} }
$sourceMessageTable = isset($config['sourceMessageTable']) ? $config['sourceMessageTable'] : '{{%source_message}}'; $sourceMessageTable = isset($config['sourceMessageTable']) ? $config['sourceMessageTable'] : '{{%source_message}}';
$messageTable = isset($config['messageTable']) ? $config['messageTable'] : '{{%message}}'; $messageTable = isset($config['messageTable']) ? $config['messageTable'] : '{{%message}}';
$this->saveMessagesToDb( $this->saveMessagesToDb(
$messages, $messages,
$db, $db,
$sourceMessageTable, $sourceMessageTable,
$messageTable, $messageTable,
$config['removeUnused'], $config['removeUnused'],
$config['languages'] $config['languages']
); );
} }
} }
...@@ -201,10 +201,10 @@ class MessageController extends Controller ...@@ -201,10 +201,10 @@ class MessageController extends Controller
$db->createCommand() $db->createCommand()
->insert($sourceMessageTable, ['category' => $category, 'message' => $m])->execute(); ->insert($sourceMessageTable, ['category' => $category, 'message' => $m])->execute();
$last_id = $db->getLastInsertID(); $lastId = $db->getLastInsertID();
foreach ($languages as $language) { foreach ($languages as $language) {
$db->createCommand() $db->createCommand()
->insert($messageTable, ['id' => $last_id, 'language' => $language])->execute(); ->insert($messageTable, ['id' => $lastId, 'language' => $language])->execute();
} }
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment