Re: [Maypole] Access to $r in CDBI before_create trigger ?

From: Tony Bowden (tony-maypole at kasei.com)
Date: Wed Nov 24 2004 - 07:36:04 GMT


On Wed, Nov 24, 2004 at 01:13:08AM +0000, Simon Flack wrote:
> AIUI, you can't add a before_create trigger at runtime on an object. E.g.
> you'll add a before_create trigger like this:
> __PACKAGE__->add_trigger(before_create => \&...);
> not like this:
> $object->add_trigger(before_create => \&...); # It's already created!

Technically you *can* add triggers to objects. It's how the 'write only
object' ability in Class::DBI works, for example.

However, adding a before_create trigger to an object doesn't make a lot
of sense as the object won't exist, in order to add the trigger, until
you have already called create() on it ...

Tony

_______________________________________________
maypole mailing list
maypole at lists.netthink.co.uk
http://lists.netthink.co.uk/listinfo/maypole



This archive was generated by hypermail 2.1.3 : Thu Feb 24 2005 - 22:25:57 GMT