private function detectDatabasePlatform()
{
if (!isset($this->_params['platform'])) {
$version = $this->getDatabasePlatformVersion();
if (null !== $version) {
$this->platform = $this->_driver->createDatabasePlatformForVersion($version);
} else {
$this->platform = $this->_driver->getDatabasePlatform();
}
} elseif ($this->_params['platform'] instanceof Platforms\AbstractPlatform) {
$this->platform = $this->_params['platform'];
} else {
throw DBALException::invalidPlatformSpecified();
}
$this->platform->setEventManager($this->_eventManager);
}