Commit 30854132 authored by pookey's avatar pookey

renaming manual files

parent 27622180
<?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!
?>
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