Artikel-Klassifizierung
[kivitendo-erp.git] / SL / DB / Manager / PartClassification.pm
1 package SL::DB::Manager::PartClassification;
2
3 use strict;
4
5 use parent qw(SL::DB::Helper::Manager);
6 use SL::DB::Helper::Sorted;
7
8 sub object_class { 'SL::DB::PartClassification' }
9
10 __PACKAGE__->make_manager_methods;
11
12 #
13 # get the one/two character shortcut of the parts classification
14 #
15 sub get_abbreviation {
16   my ($class,$id) = @_;
17   my $obj = $class->get_first(query => [ id => $id ]);
18   return '' unless $obj;
19   return $obj->abbreviation?$obj->abbreviation:'';
20 }
21
22 1;
23
24
25 __END__
26
27 =encoding utf-8
28
29 =head1 NAME
30
31 SL::DB::Manager::PartClassification
32
33
34 =head1 SYNOPSIS
35
36 This class has wrapper methodes to get the shortcuts
37
38 =head1 METHODS
39
40 =head2 get_abbreviation
41
42  $class->get_abbreviation($classification_id);
43
44 get the one/two character shortcut of the parts classification
45
46 =head2 get_separate_abbreviation
47
48  $class->get_separate_abbreviation($classification_id);
49
50 get the one/two character shortcut of the parts classification if it is a separate article
51
52 =head1 AUTHOR
53
54 Martin Helmling E<lt>martin.helmling@opendynamic.deE<gt>
55
56 =cut