3.2 compat

This commit is contained in:
Christopher Pitt 2015-08-28 08:43:03 +12:00
parent 10787bc310
commit 3ad9369b0a

View File

@ -43,7 +43,16 @@ class SearchUpdater extends Object {
require_once($file); require_once($file);
$dbClass = 'SearchManipulateCapture_'.$type; $dbClass = 'SearchManipulateCapture_'.$type;
/** @var SS_Database $captured */
$captured = new $dbClass($databaseConfig); $captured = new $dbClass($databaseConfig);
// Framework 3.2+ ORM needs some dependencies set
if (method_exists($captured, "setConnector")) {
$captured->setConnector($current->getConnector());
$captured->setQueryBuilder($current->getQueryBuilder());
$captured->setSchemaManager($current->getSchemaManager());
}
// The connection might have had it's name changed (like if we're currently in a test) // The connection might have had it's name changed (like if we're currently in a test)
$captured->selectDatabase($current->currentDatabase()); $captured->selectDatabase($current->currentDatabase());
DB::setConn($captured); DB::setConn($captured);