From 42646def7270f58d3943e8cf19943cb61bdb5ad8 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Wed, 26 Jun 2013 11:04:14 +0200 Subject: [PATCH] Kein use von DB-Objekten in DB-Objekten --- SL/DB/CustomVariable.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index c90e03800..edc595ce4 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -4,10 +4,7 @@ package SL::DB::CustomVariable; use strict; - use SL::DB::MetaSetup::CustomVariable; -use SL::DB::CustomVariableValidity; -use SL::DB::Customer; __PACKAGE__->meta->initialize; @@ -26,6 +23,8 @@ sub value { goto &number_value; } else { + require SL::DB::Customer; + my $id = int($self->number_value); return $id ? SL::DB::Customer->new(id => $id)->load() : 0; } @@ -36,6 +35,8 @@ sub value { sub is_valid { my ($self) = @_; + require SL::DB::CustomVariableValidity; + return SL::DB::Manager::CustomVariableValidity->get_all_count(config_id => $self->config_id, trans_id => $self->trans_id) == 0; } -- 2.20.1