Hello,
I created a class extending Doctrine_Record_Listener but can't seem to
get the values I am looking for.
I have attached the listener to the specific connection I am wanting
to log Insert/Update/Delete queries done by certain users in our
system.
My Class:
class App_Log_Database extends Doctrine_Record_Listener
{
public function postInsert(Doctrine_Event $event)
{
echo 'inserting a record ...';
}
public function postUpdate(Doctrine_Event $event)
{
$invoker = $event->getInvoker();
echo $event->getName();
echo $event->getQuery();
print_r($event->getParams());
if($event->getElapsedSecs()) {
echo "yay";
} else {
echo "Updating row for user..."
}
}
public function postDelete(Doctrine_Event $event)
{
echo 'deleting a record...';
}
}
The result when posting the form to update:
update recordArray ( ) Updating row for user...
What my end goal is to save the query and parameters of each query and
the user that performed the query into a database log. The more
information I can gather about the query the better. Why am I having
such a hard time getting the variables and the query?
Please reply as I am running out of ideas....
Thanks!
Nick
http://blog.routydesign.com