Kosmetik, Toten Code identifizieren, Alphabetische Reihenfolge Module
[kivitendo-erp.git] / SL / DB / Helper / Filtered.pm
index 15e0985..a0f522b 100644 (file)
@@ -10,13 +10,13 @@ our @EXPORT = qw (filter add_filter_specs);
 my %filter_spec;
 
 sub filter {
-  my ($class, $key, $value, $prefix) = @_;
+  my ($class, $key, $value, $prefix, $path, @additional_tokens) = @_;
 
   my $filters = _get_filters($class);
 
-  return ($key, $value) unless $filters->{$key};
+  return ($prefix . $key, $value, $path) unless $filters->{$key};
 
-  return $filters->{$key}->($key, $value, $prefix);
+  return $filters->{$key}->($key, $value, $prefix, @additional_tokens);
 }
 
 sub _get_filters {
@@ -43,13 +43,13 @@ __END__
 
 =head1 NAME
 
-SL::Helper::Sorted - Manager mixin for filtered results.
+SL::DB::Helper::Filtered - Manager mixin for filtered results.
 
 =head1 SYNOPSIS
 
 In the manager:
 
-  use SL::Helper::Filtered;
+  use SL::DB::Helper::Filtered;
 
   __PACKAGE__->add_filter_specs(
     custom_filter_name => sub {
@@ -78,7 +78,7 @@ You can add multiple filters in one call, but only one filter per key.
 
 =item C<filter $key, $value, $prefix>
 
-Tells the manager to pply custom filters. If none is registered for C<$key>,
+Tells the manager to apply custom filters. If none are registered for C<$key>,
 returns C<$key, $value>.
 
 Otherwise the filter code is called.
@@ -164,7 +164,7 @@ to make sense to Rose.
 
 =item *
 
-You are expeceted to return exactly one key and one value. That can mean you
+You are expected to return exactly one key and one value. That can mean you
 have to encapsulate your arguments into C<< or => [] >> or C<< and => [] >> blocks.
 
 =item *