From 23b83d0e665874c7527c5f738d170cc3af380af8 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Thu, 13 Jan 2011 13:28:19 +0100 Subject: [PATCH] =?utf8?q?Convenience:=20Config-Value=20aus=20auth.user=5F?= =?utf8?q?configs=20=C3=BCber=20AuthUser-Objekt=20auslesen?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/DB/AuthUser.pm | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/SL/DB/AuthUser.pm b/SL/DB/AuthUser.pm index 0d22be94f..2a15449d6 100644 --- a/SL/DB/AuthUser.pm +++ b/SL/DB/AuthUser.pm @@ -5,6 +5,8 @@ package SL::DB::AuthUser; use strict; +use List::Util qw(first); + use SL::DB::MetaSetup::AuthUser; use SL::DB::AuthUserGroup; @@ -29,4 +31,11 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; +sub get_config_value { + my ($self, $key) = @_; + + my $cfg = first { $_->cfg_key eq $key } @{ $self->configs }; + return $cfg ? $cfg->cfg_value : undef; +} + 1; -- 2.20.1