partpicker mit classification_id als filter erweitert
[kivitendo-erp.git] / SL / DB / Manager / PartClassification.pm
index c00bea7..9730f44 100644 (file)
@@ -9,6 +9,17 @@ sub object_class { 'SL::DB::PartClassification' }
 
 __PACKAGE__->make_manager_methods;
 
+sub classification_filter {
+  my ($class, $classification, $prefix) = @_;
+
+  return () unless $classification;
+
+  $prefix //= '';
+
+  my @classifications = grep { $_ } listify($classification);
+  return ( $prefix . 'classification_id' => \@classifications );
+}
+
 1;