From: Chris W. <ch...@cw...> - 2002-08-12 16:02:50
|
* Ray Zimmerman (rz...@co...) [020812 09:39]: > Hi Chris, > > Thanks for including the refetch() and field_update() in the latest > SPOPS. Could you clarify what you were referring to in the Changes > file: > > >This updates the values for a limited number of fields, or performs > >an update across several objects at once. > > ... and in the docs for field_update() ... > > >Note that this rubs against the grain of one object == one update. But > >it is quite useful, and useful things tend to stick around. Umm... I was referring to the future change that was just implemented! > I never envisioned doing updates across multiple objects with a > single field_update() call, though it does sound useful. Does it > really work? I assume you'd call it as a class method and specify a > where clause, right? Something like ... > > Class->field_update( { status => 'OFF' }, > { where => 'output = 0' } ); Exactly. > But what about the calls to $self->id_clause( undef, undef, $p ) in > field_update()? ... ah, that just returns undef, eh? Pretty slick. I fixed this so it will only be called if it's an object. > So, assuming I've got it right, maybe we should include an example of > this in the docs as well ... it never would have occurred to me if > you hadn't hinted at it in the Changes file. Yep, docs are now update. I also added a test in t/30_dbi.t for this as well. Thanks for pointing this out! Chris -- Chris Winters (ch...@cw...) Building enterprise-capable snack solutions since 1988 |