1
0
mirror of synced 2025-02-20 06:03:15 +03:00
This commit is contained in:
zYne 2007-06-26 12:08:50 +00:00
parent 397607762b
commit 8b8ae07e00
3 changed files with 9 additions and 4 deletions

View File

@ -976,11 +976,15 @@ abstract class Doctrine_Connection extends Doctrine_Configurable implements Coun
*/
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->dbh = null;
$this->getAttribute(Doctrine::ATTR_LISTENER)->onClose($this);
$this->getAttribute(Doctrine::ATTR_LISTENER)->postClose($event);
}
/**
* get the current transaction nesting level

View File

@ -38,6 +38,7 @@ class Doctrine_Event
const CONN_EXEC = 2;
const CONN_PREPARE = 3;
const CONN_CONNECT = 4;
const CONN_CLOSE = 5;
const STMT_EXECUTE = 10;
const STMT_FETCH = 11;

View File

@ -50,9 +50,9 @@ class Doctrine_EventListener implements Doctrine_EventListener_Interface
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)