Revision c55135b7
Von Moritz Bunkus vor mehr als 10 Jahren hinzugefügt
SL/DB/Unit.pm | ||
---|---|---|
39 | 39 |
sub base_factor { |
40 | 40 |
my ($self) = @_; |
41 | 41 |
|
42 |
if (!defined $self->{__base_factor}) { |
|
43 |
$self->{__base_factor} = !$self->base_unit || !$self->factor || ($self->name eq $self->base_unit) ? 1 : $self->factor * $self->base->base_factor; |
|
42 |
my $cache = $::request->cache('base_factor'); |
|
43 |
|
|
44 |
if (!defined $cache->{$self->id}) { |
|
45 |
$cache->{$self->id} = !$self->base_unit || !$self->factor || ($self->name eq $self->base_unit) ? 1 : $self->factor * $self->base->base_factor; |
|
44 | 46 |
} |
45 | 47 |
|
46 |
return $self->{__base_factor};
|
|
48 |
return $cache->{$self->id};
|
|
47 | 49 |
} |
48 | 50 |
|
49 | 51 |
sub convert_to { |
Auch abrufbar als: Unified diff
SL::DB::Unit::base_factor: Verwendung von $::request->cache()