Commit 867821aa authored by jsor's avatar jsor

Add event manager to platforms and pass an instance from the connection constructor

parent 23d2950c
...@@ -214,6 +214,8 @@ class Connection implements DriverConnection ...@@ -214,6 +214,8 @@ class Connection implements DriverConnection
throw DBALException::invalidPlatformSpecified(); throw DBALException::invalidPlatformSpecified();
} }
$this->_platform->setEventManager($eventManager);
$this->_transactionIsolationLevel = $this->_platform->getDefaultTransactionIsolationLevel(); $this->_transactionIsolationLevel = $this->_platform->getDefaultTransactionIsolationLevel();
} }
......
...@@ -27,7 +27,8 @@ use Doctrine\DBAL\DBALException, ...@@ -27,7 +27,8 @@ use Doctrine\DBAL\DBALException,
Doctrine\DBAL\Schema\ForeignKeyConstraint, Doctrine\DBAL\Schema\ForeignKeyConstraint,
Doctrine\DBAL\Schema\TableDiff, Doctrine\DBAL\Schema\TableDiff,
Doctrine\DBAL\Schema\Column, Doctrine\DBAL\Schema\Column,
Doctrine\DBAL\Types\Type; Doctrine\DBAL\Types\Type,
Doctrine\Common\EventManager;
/** /**
* Base class for all DatabasePlatforms. The DatabasePlatforms are the central * Base class for all DatabasePlatforms. The DatabasePlatforms are the central
...@@ -90,11 +91,36 @@ abstract class AbstractPlatform ...@@ -90,11 +91,36 @@ abstract class AbstractPlatform
*/ */
protected $doctrineTypeComments = null; protected $doctrineTypeComments = null;
/**
* @var Doctrine\Common\EventManager
*/
protected $_eventManager;
/** /**
* Constructor. * Constructor.
*/ */
public function __construct() {} public function __construct() {}
/**
* Sets the EventManager used by the Platform.
*
* @rparam \Doctrine\Common\EventManager
*/
public function setEventManager(EventManager $eventManager)
{
$this->_eventManager = $eventManager;
}
/**
* Gets the EventManager used by the Platform.
*
* @return \Doctrine\Common\EventManager
*/
public function getEventManager()
{
return $this->_eventManager;
}
/** /**
* Gets the SQL snippet that declares a boolean column. * Gets the SQL snippet that declares a boolean column.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment