This commit is contained in:
parent
397607762b
commit
8b8ae07e00
@ -976,11 +976,15 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
|
|||||||
*/
|
*/
|
||||||
public function close()
|
public function close()
|
||||||
{
|
{
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->onPreClose($this);
|
$event = new Doctrine_Event($this, Doctrine_Event::CONN_CLOSE);
|
||||||
|
|
||||||
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->preClose($event);
|
||||||
|
|
||||||
$this->clear();
|
$this->clear();
|
||||||
|
|
||||||
$this->getAttribute(Doctrine::ATTR_LISTENER)->onClose($this);
|
$this->dbh = null;
|
||||||
|
|
||||||
|
$this->getAttribute(Doctrine::ATTR_LISTENER)->postClose($event);
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* get the current transaction nesting level
|
* get the current transaction nesting level
|
||||||
|
@ -38,6 +38,7 @@ class Doctrine_Event
|
|||||||
const CONN_EXEC = 2;
|
const CONN_EXEC = 2;
|
||||||
const CONN_PREPARE = 3;
|
const CONN_PREPARE = 3;
|
||||||
const CONN_CONNECT = 4;
|
const CONN_CONNECT = 4;
|
||||||
|
const CONN_CLOSE = 5;
|
||||||
|
|
||||||
const STMT_EXECUTE = 10;
|
const STMT_EXECUTE = 10;
|
||||||
const STMT_FETCH = 11;
|
const STMT_FETCH = 11;
|
||||||
|
@ -50,9 +50,9 @@ class Doctrine_EventListener implements Doctrine_EventListener_Interface
|
|||||||
public function onPreEvict(Doctrine_Record $record)
|
public function onPreEvict(Doctrine_Record $record)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public function onClose(Doctrine_Event $event)
|
public function preClose(Doctrine_Event $event)
|
||||||
{ }
|
{ }
|
||||||
public function onPreClose(Doctrine_Event $event)
|
public function postClose(Doctrine_Event $event)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
public function onCollectionDelete(Doctrine_Collection $collection)
|
public function onCollectionDelete(Doctrine_Collection $collection)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user