Skip to content

Commit

Permalink
Database: added $onConnect event to Connection
Browse files Browse the repository at this point in the history
  • Loading branch information
dg committed Apr 30, 2013
1 parent 61c9d9f commit 7f98d09
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Nette/Database/Connection.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,9 @@ class Connection extends Nette\Object
/** @var PDO */
private $pdo;

/** @var array of function(Connection $connection); Occurs after connection is established */
public $onConnect;

/** @var array of function(Connection $connection, ResultSet|Exception $result); Occurs after query is executed */
public $onQuery;

Expand Down Expand Up @@ -79,6 +82,7 @@ private function connect()
: $this->options['driverClass'];
$this->driver = new $class($this, $this->options);
$this->preprocessor = new SqlPreprocessor($this);
$this->onConnect($this);
}


Expand Down

0 comments on commit 7f98d09

Please sign in to comment.