Db::getConnection()
\nn\t3::Db()->getConnection();
Eine "rohe" Verbindung zur Datenbank holen. Nur in wirklichen Ausnahmefällen sinnvoll.
$connection = \nn\t3::Db()->getConnection();
$connection->fetchAll( 'SELECT FROM tt_news WHERE 1;' );
Copied!
| @return \TYPO3\CMS\Core\Database\Connection
Source Code
public function getConnection()
{
$connectionPool = GeneralUtility::makeInstance(ConnectionPool::class);
$connectionName = array_shift($connectionPool->getConnectionNames());
return $connectionPool->getConnectionByName( $connectionName );
}
Copied!