Merge pull request #83 from assertchris/3.2-compat

3.2 compat
This commit is contained in:
Damian Mooyman 2015-08-28 11:46:23 +12:00
commit c3cc3f999b

View File

@ -43,7 +43,16 @@ class SearchUpdater extends Object {
require_once($file);
$dbClass = 'SearchManipulateCapture_'.$type;
/** @var SS_Database $captured */
$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)
$captured->selectDatabase($current->currentDatabase());
DB::setConn($captured);