protected function _getConnection()
{
if (!isset(self::$_conn)) {
self::$_conn = DriverManager::getConnection($this->_getDbParams(), new Configuration());
self::$_conn->getEventManager()->addEventSubscriber(new ORMSchemaEventSubscriber());
Configurator::configure(self::$_conn->getConfiguration());
if (!Type::hasType('tsvector')) {
Type::addType('tsvector', 'Doctrine\\DBAL\\Types\\TextType');
}
$platform = self::$_conn->getDatabasePlatform();
$platform->registerDoctrineTypeMapping('tsvector', 'tsvector');
}
return self::$_conn;
}