Re: Can you $Class->update_all() ?
[prev]
[thread]
[next]
[Date index for 2004/07/19]
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
|
|
Re: Can you $Class->update_all() ?
Perrin Harkins 18:01 on 19 Jul 2004
|