From 0bc6d28c1a54fe96651f95405ce2b5ae4452af21 Mon Sep 17 00:00:00 2001 From: Thomas Heck Date: Fri, 3 May 2013 15:52:14 +0200 Subject: [PATCH] =?utf8?q?Validity-Accessor=20f=C3=BCr=20CVars?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/CustomVariable.pm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/SL/DB/CustomVariable.pm b/SL/DB/CustomVariable.pm index 09718de65..83ee89db7 100644 --- a/SL/DB/CustomVariable.pm +++ b/SL/DB/CustomVariable.pm @@ -6,6 +6,7 @@ package SL::DB::CustomVariable; use strict; use SL::DB::MetaSetup::CustomVariable; +use SL::DB::CustomVariableValidity; __PACKAGE__->meta->initialize; @@ -22,4 +23,10 @@ sub value { goto &text_value; # text and select } +sub is_valid { + my ($self) = @_; + + return SL::DB::Manager::CustomVariableValidity->get_all_count(config_id => $self->config_id, trans_id => $self->trans_id) == 0; +} + 1; -- 2.20.1