1
0
mirror of synced 2025-01-18 22:41:43 +03:00

renaming manual files

This commit is contained in:
pookey 2006-11-11 20:17:06 +00:00
parent 276221803e
commit 308541322b
4 changed files with 36 additions and 0 deletions

View File

@ -0,0 +1,36 @@
<?php
// using PDO dsn for connecting sqlite memory table
$dbh = Doctrine_Db::getConnection('sqlite::memory:');
class MyLogger extends Doctrine_Db_EventListener {
public function onPreQuery(Doctrine_Db_Event $event) {
print "database is going to be queried!";
}
public function onQuery(Doctrine_Db_Event $event) {
print "executed: " . $event->getQuery();
}
}
$dbh->setListener(new MyLogger());
$dbh->query("SELECT * FROM foo");
// prints:
// database is going to be queried
// executed: SELECT * FROM foo
class MyLogger2 extends Doctrine_Overloadable {
public function __call($m, $a) {
print $m." called!";
}
}
$dbh->setListener(new MyLogger2());
$dbh->exec("DELETE FROM foo");
// prints:
// onPreExec called!
// onExec called!
?>