[CDBI] Updating data automatically after a search (trigger)

Kjell Arne class_dbi at siegedesign.no
Wed Feb 1 14:12:02 GMT 2006


I've just started using Class::DBI in my project and I want to update a
timestamp every time an object has been search()'ed for.
That way I can see the last time an object was searched for.

Example with a session object:
my $session = My::Session->search(pin => $pin) if $pin;

I basically want something like this to happen in session.pm:
sub search {
    my ($self, $DATA) = shift;


    // This will fail as $self is not blessed
    // **

In theory triggers would be my friend here but there is no support for
an "after_search" trigger.
Any hints or tips are greatly appreciated as I'm totally new to the
wonderful world of Class::DBI.

- Kjell Arne

More information about the ClassDBI mailing list