|
Lines 32-46
and authority) records in Koha.
Link Here
|
| 32 |
|
32 |
|
| 33 |
=cut |
33 |
=cut |
| 34 |
|
34 |
|
| 35 |
use strict; |
35 |
use Modern::Perl; |
| 36 |
use warnings; |
36 |
|
| 37 |
use C4::Context; |
37 |
use Carp; |
| 38 |
use Koha::Util::MARC; |
38 |
use Koha::Util::MARC; |
| 39 |
|
39 |
|
| 40 |
use base qw(Class::Accessor); |
40 |
use base qw(Class::Accessor); |
| 41 |
|
41 |
|
| 42 |
__PACKAGE__->mk_accessors(qw( record schema )); |
42 |
__PACKAGE__->mk_accessors(qw( record schema format )); |
|
|
43 |
|
| 44 |
|
| 45 |
sub new { |
| 43 |
|
46 |
|
|
|
47 |
my $class = shift; |
| 48 |
my $params = shift; |
| 49 |
|
| 50 |
if (!defined $params->{ record }) { |
| 51 |
carp 'No record passed'; |
| 52 |
return; |
| 53 |
} |
| 54 |
|
| 55 |
my $record = $params->{ record }; |
| 56 |
my $schema = $params->{ schema } // 'marc21'; |
| 57 |
my $format = $params->{ format } // 'usmarc'; |
| 58 |
|
| 59 |
my $self = $class->SUPER::new({ |
| 60 |
record => $record, |
| 61 |
schema => $schema, |
| 62 |
format => $format |
| 63 |
}); |
| 64 |
|
| 65 |
bless $self, $class; |
| 66 |
return $self; |
| 67 |
} |
| 44 |
|
68 |
|
| 45 |
=head2 createMergeHash |
69 |
=head2 createMergeHash |
| 46 |
|
70 |
|
| 47 |
- |
|
|