Файл: vendor/doctrine/dbal/src/Event/Listeners/SQLiteSessionInit.php
Строк: 49
<?php
namespace DoctrineDBALEventListeners;
use DoctrineCommonEventSubscriber;
use DoctrineDBALEventConnectionEventArgs;
use DoctrineDBALEvents;
use DoctrineDBALException;
/** @deprecated Use {@see DoctrineDBALDriverAbstractSQLiteDriverMiddlewareEnableForeignKeys} instead. */
class SQLiteSessionInit implements EventSubscriber
{
/**
* @return void
*
* @throws Exception
*/
public function postConnect(ConnectionEventArgs $args)
{
$args->getConnection()->executeStatement('PRAGMA foreign_keys=ON');
}
/**
* {@inheritDoc}
*/
public function getSubscribedEvents()
{
return [Events::postConnect];
}
}