Doctrine\DBAL\Connection::detectDatabasePlatform PHP Method

detectDatabasePlatform() private method

Evaluates custom platform class and version in order to set the correct platform.
    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);
    }