Re: [CDBI] after_set_$col and after_create

[prev] [thread] [next] [Date index for 2005/10/27]

From: Perrin Harkins
Subject: Re: [CDBI] after_set_$col and after_create
Date: 16:38 on 27 Oct 2005
On Thu, 2005-10-27 at 09:15 -0400, Michael Peters wrote:
> But I'm still a little confused as to why the before_set_$column isn't
> working for you. It should be called both on update and insert. At least
> according to the docs for 3.0.1:
> 
>    All triggers are passed the object they are being fired for, except
>    when before_set_$column is fired during "insert", in which case the
>    class is passed in place of the object, which does not yet exist. You
>    may change object values if required.
> 
> So it does get called on insert, but you have to do a little bit of
> param investigation to determine if you actually have the object, or
> just a class and a hash of data.

It amounts to having to write two completely separate methods, since
most of the code is going to be handling the different ways of getting
the data.  That's what bothered me about it.  Class::DBI should be able
to offer a uniform API for transforming data on a column when it gets
set.

- Perrin


_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi

[CDBI] after_set_$col and after_create
Kate Yoak 03:07 on 25 Oct 2005

Re: [CDBI] after_set_$col and after_create
Michael Peters 12:10 on 25 Oct 2005

RE: [CDBI] after_set_$col and after_create
Kate Yoak 01:15 on 26 Oct 2005

Re: [CDBI] after_set_$col and after_create
Michael Peters 13:15 on 27 Oct 2005

Re: [CDBI] after_set_$col and after_create
Perrin Harkins 16:38 on 27 Oct 2005

[CDBI] Re: after_set_$col and after_create
Edward J. Sabol 17:39 on 27 Oct 2005

Re: [CDBI] after_set_$col and after_create
Perrin Harkins 16:52 on 25 Oct 2005

Generated at 09:28 on 02 Nov 2005 by mariachi v0.52