X-Git-Url: http://wagnertech.de/gitweb/gitweb.cgi/mfinanz.git/blobdiff_plain/65d2537d658b99b005a18c6663bc1293b41a1d83..c954dea7c1b814d66b8c31d04fa70a1bbbcce71e:/SL/DB/Manager/PartClassification.pm?ds=sidebyside diff --git a/SL/DB/Manager/PartClassification.pm b/SL/DB/Manager/PartClassification.pm index 0924011e7..9730f4482 100644 --- a/SL/DB/Manager/PartClassification.pm +++ b/SL/DB/Manager/PartClassification.pm @@ -9,14 +9,15 @@ sub object_class { 'SL::DB::PartClassification' } __PACKAGE__->make_manager_methods; -# -# get the one/two character shortcut of the parts classification -# -sub get_abbreviation { - my ($class,$id) = @_; - my $obj = $class->get_first(query => [ id => $id ]); - return '' unless $obj; - return $obj->abbreviation?$obj->abbreviation:''; +sub classification_filter { + my ($class, $classification, $prefix) = @_; + + return () unless $classification; + + $prefix //= ''; + + my @classifications = grep { $_ } listify($classification); + return ( $prefix . 'classification_id' => \@classifications ); } 1; @@ -30,27 +31,4 @@ __END__ SL::DB::Manager::PartClassification - -=head1 SYNOPSIS - -This class has wrapper methodes to get the shortcuts - -=head1 METHODS - -=head2 get_abbreviation - - $class->get_abbreviation($classification_id); - -get the one/two character shortcut of the parts classification - -=head2 get_separate_abbreviation - - $class->get_separate_abbreviation($classification_id); - -get the one/two character shortcut of the parts classification if it is a separate article - -=head1 AUTHOR - -Martin Helmling Emartin.helmling@opendynamic.deE - =cut