summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2016-03-23 20:58:52 -0700
committerIvan Kohler <ivan@freeside.biz>2016-03-23 20:58:52 -0700
commitf90f0685f9855a840c8e49c895dcce1ce0752ae0 (patch)
tree3e04954ef7085303529dc232d7979661cdb26275 /FS
parent705f668e3409858d6c34500d4c18cbcdf7b2ebd7 (diff)
optimize customer list, RT#20173
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/pkg_svc.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/FS/FS/pkg_svc.pm b/FS/FS/pkg_svc.pm
index fa82ec05b..666d76b73 100644
--- a/FS/FS/pkg_svc.pm
+++ b/FS/FS/pkg_svc.pm
@@ -1,12 +1,19 @@
package FS::pkg_svc;
+use base qw(FS::Record);
use strict;
-use vars qw( @ISA );
use FS::Record qw( qsearchs );
use FS::part_pkg;
use FS::part_svc;
-@ISA = qw( FS::Record );
+our $cache_enabled = 0;
+
+sub _simplecache {
+ my( $self, $hashref ) = @_;
+ if ( $cache_enabled && $hashref->{'svc'} ) {
+ $self->{'_svcpart'} = FS::part_svc->new($hashref);
+ }
+}
=head1 NAME
@@ -148,6 +155,7 @@ Returns the FS::part_svc object (see L<FS::part_svc>).
sub part_svc {
my $self = shift;
+ return $self->{_svcpart} if $self->{_svcpart};
qsearchs( 'part_svc', { 'svcpart' => $self->svcpart } );
}