From 30f3d7d11e28f302170e6b6af75cae35fd86a8fb Mon Sep 17 00:00:00 2001 From: erickson Date: Thu, 10 Aug 2006 16:30:05 +0000 Subject: [PATCH] added method to retrieve org by shortname git-svn-id: svn://svn.open-ils.org/ILS/trunk@5422 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- Open-ILS/src/perlmods/OpenILS/Application/Actor.pm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm index 9377c9d882..41830f6845 100644 --- a/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm +++ b/Open-ILS/src/perlmods/OpenILS/Application/Actor.pm @@ -2383,6 +2383,18 @@ sub retrieve_net_levels { } +__PACKAGE__->register_method( + method => 'fetch_org_by_shortname', + api_name => 'open-ils.actor.org_unit.retrieve_by_shorname', +); +sub fetch_org_by_shortname { + my( $self, $conn, $sname ) = @_; + my $e = new_editor(); + my $org = $e->search_actor_org_unit({ shortname => uc($sname)})->[0]; + return $e->event unless $org; + return $org; +} + 1; -- 2.11.0