From: Sven Schöling Date: Tue, 30 Jan 2018 09:59:07 +0000 (+0100) Subject: PriceSource: fast Flag für zukünftige Performanceoptimierungen X-Git-Tag: release-3.5.4~486 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=ab719aed946b050dc2df230fb31fa7b6eda14845;p=kivitendo-erp.git PriceSource: fast Flag für zukünftige Performanceoptimierungen --- diff --git a/SL/PriceSource.pm b/SL/PriceSource.pm index 6fd3cbcee..05168ce67 100644 --- a/SL/PriceSource.pm +++ b/SL/PriceSource.pm @@ -3,7 +3,7 @@ package SL::PriceSource; use strict; use parent 'SL::DB::Object'; use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(record_item record) ], + scalar => [ qw(record_item record fast) ], 'scalar --get_set_init' => [ qw( best_price best_discount ) ], @@ -31,7 +31,7 @@ sub price_source_by_class { return unless $class; $self->{price_source_by_name}{$class} //= - $class->new(record_item => $self->record_item, record => $self->record); + $class->new(record_item => $self->record_item, record => $self->record, fast => $self->fast); } sub price_from_source { @@ -253,8 +253,19 @@ opens the price field to manual changes. A special empty discount that does not change the previously entered discount and opens the discount field to manual changes. +=item C + +If set to true, indicates that calls may skip doing intensive work and instead +return a price or discount flagged as unknown. The caller must be prepared to +deal with those. + +Typically this is intended to delay expensive calculations until they can be +done in a second batch pass. If the information is already present, it is still +encouraged that implementations return the correct values. + =back + =head1 SEE ALSO L, diff --git a/SL/PriceSource/Base.pm b/SL/PriceSource/Base.pm index 9382f108f..8cc388807 100644 --- a/SL/PriceSource/Base.pm +++ b/SL/PriceSource/Base.pm @@ -4,7 +4,7 @@ use strict; use parent qw(SL::DB::Object); use Rose::Object::MakeMethods::Generic ( - scalar => [ qw(record_item record) ], + scalar => [ qw(record_item record fast) ], ); sub name { die 'name needs to be implemented' }