Re: Can you $Class->update_all() ?

[prev] [thread] [next] [Date index for 2004/07/19]

From: Perrin Harkins
Subject: Re: Can you $Class->update_all() ?
Date: 18:01 on 19 Jul 2004
On Mon, 2004-07-19 at 13:53, Ian McDonald-ONLINE wrote:
> For my application, I'd like to be able to issue a single command
> which will run update on every Class::DBI object which needs it, and
> does not generate SQL for those which do not.

When you call $obj->update() on an object that has not been changed, it
doesn't run any SQL.  (It does run trigger methods, if you have defined
any.)

However, I'm not sure what you mean by calling this as a class method. 
There's no way for a class to know what instances are in memory right
now, unless you do something like peek into the %Live_Objects index. 
When objects go out of scope, any unsaved changes to them are lost.  (I
believe you get a warning if a changed object goes out of scope.)

- Perrin

Can you $Class->update_all() ?
Ian McDonald-ONLINE 17:53 on 19 Jul 2004

Re: Can you $Class->update_all() ?
Perrin Harkins 18:01 on 19 Jul 2004

Re: Can you $Class->update_all() ?
Charles Bailey 18:13 on 19 Jul 2004

Generated at 11:34 on 01 Dec 2004 by mariachi v0.52