Re: [CDBI] Scope of autoupdate/update?
[prev]
[thread]
[next]
[Date index for 2005/08/02]
On 2 Aug 2005, at 20:54, Christopher H. Laco wrote:
> Christopher H. Laco wrote:
>
>
>> I think it should be possible to create a custom HAS_A
>> relationship class that automatically flips the autoupdate bit
>> based on the parents autoupdate bit, but that of course assumes
>> that autoupdate is scoped correctly.
>>
>
> So, with that said, what's the best way to disable the autoupdate
> for all instances returned by a has_a relationship without actually
> cycling through each result before passing it along?
Custom inflation method?
Handel::Cart->has_a(thing => 'My::Artist',
inflate => 'inflate_without_autoupdate',
);
and in your base class, something like:
sub inflate_without_autoupdate {
my ($class, $id) = @_;
my $self = $class->_simple_bless($id);
$self->autoupdate(0);
return $self;
}
but I haven't ever needed to do this, nor tested any of the above :)
will
_______________________________________________
ClassDBI mailing list
ClassDBI@xxxxx.xxxxxxxxxxxxxxxx.xxx
http://lists.digitalcraftsmen.net/mailman/listinfo/classdbi