Koha::RecordProcessor::Base - Base class for RecordProcessor filters
use base qw(Koha::RecordProcessor::Base);
Base class for record normalizer filters. RecordProcessors must provide the following methods:
filter ($record) - apply the filter and return the result. $record may be either a scalar or an arrayref, and the return result will be the same type.
The following variables must be defined in each filter: our $NAME ='Filter'; our $VERSION = '1.0';
These methods may be overriden:
initialize (%params) - initialize the filter
destroy () - destroy the filter
These methods should not be overridden unless you are very sure of what you are doing:
new () - create a new filter object
Note that the RecordProcessor will not clone the record that is passed in. If you do not want to change the original MARC::Record object (or whatever type of object you are passing in), you must clone it prior to passing it off to the RecordProcessor.
my $filter = Koha::RecordProcessor::Base->new;
Create a new filter;
Initialize a filter using the specified parameters.
Destroy the filter.
my $newrecord = $filter->filter($record); my $newrecords = $filter->filter(\@records);
Filter the specified record(s) and return the result.