From 5916be6b96be6564f9e35188930a2d67654efbbc Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 25 Oct 2010 15:13:38 +0200 Subject: [PATCH] Convenience-Funktion zum Auslesen von Employee-Objekten zu einer AuthGroup --- SL/DB/AuthGroup.pm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/SL/DB/AuthGroup.pm b/SL/DB/AuthGroup.pm index 8bd54506c..fe755c7b5 100644 --- a/SL/DB/AuthGroup.pm +++ b/SL/DB/AuthGroup.pm @@ -29,4 +29,9 @@ __PACKAGE__->meta->add_relationship( __PACKAGE__->meta->initialize; +sub get_employees { + my @logins = map { $_->login } $_[0]->users; + return @logins ? @{ SL::DB::Manager::Employee->get_all(query => [ login => \@logins ]) } : (); +} + 1; -- 2.20.1