partpicker mit classification_id als filter erweitert
[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 sub classification_filter {
13   my ($class, $classification, $prefix) = @_;
14
15   return () unless $classification;
16
17   $prefix //= '';
18
19   my @classifications = grep { $_ } listify($classification);
20   return ( $prefix . 'classification_id' => \@classifications );
21 }
22
23 1;
24
25
26 __END__
27
28 =encoding utf-8
29
30 =head1 NAME
31
32 SL::DB::Manager::PartClassification
33
34 =cut