Bug 25008: Overload Koha::RecordProcessor->options to update filters
This patch overloads the 'options' accessor generated by Class:Accessor. It does so the passed options are used to refresh the loaded filters. Tests are added for this overloaded method as well. To test: 1. Apply this patches 2. Run: $ kshell k$ prove t/RecordProcessor.t => SUCCESS: Tests pass! 3. Sign off :-D Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org> Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>
This commit is contained in:
parent
7bcfa82197
commit
0004816118
1 changed files with 23 additions and 0 deletions
|
@ -121,6 +121,29 @@ sub new {
|
|||
return $self;
|
||||
}
|
||||
|
||||
=head3 options
|
||||
|
||||
$processor->options( $new_options );
|
||||
|
||||
Overloaded accessor, that spreads the new options to the filter objects when set
|
||||
|
||||
=cut
|
||||
|
||||
sub options {
|
||||
my ( $self, $options ) = @_;
|
||||
|
||||
if ( $options ) { # Set
|
||||
foreach my $filter ( @{$self->filters} ) {
|
||||
$filter->params->{options} = $options;
|
||||
}
|
||||
|
||||
$self->{options} = $options;
|
||||
return $self;
|
||||
}
|
||||
|
||||
return $self->{options};
|
||||
}
|
||||
|
||||
=head2 bind
|
||||
|
||||
$normalizer->bind($record)
|
||||
|
|
Loading…
Reference in a new issue