| 1 | package MARC::Validator::Plugin::Field260; | ||||||||||
| 2 | |||||||||||
| 3 | 6 | ▶ | use base qw(MARC::Validator::Abstract); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 6 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 6 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | |||||||||||
| 7 | 6 | ▶ | use Data::MARC::Validator::Report::Error 0.02; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | 6 | ▶ | use Data::MARC::Validator::Report::Plugin::Errors 0.02; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 9 | 6 | ▶ | use MARC::Validator::Utils qw(check_260c_year); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | 6 | our $VERSION = 0.25; | |||||||||
| 12 | |||||||||||
| 13 | 3 | ▶ | sub module_name { | ||||||||
|
Subroutine
module_name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 14 | 3 | my $self = shift; | |||||||||
| 15 | |||||||||||
| 16 | 3 | return __PACKAGE__; | |||||||||
| 17 | } | ||||||||||
| 18 | |||||||||||
| 19 | 4 | ▶ | sub name { | ||||||||
|
Subroutine
name: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 20 | 4 | my $self = shift; | |||||||||
| 21 | |||||||||||
| 22 | 4 | return 'field_260'; | |||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 1 | ▶ | sub process { | ||||||||
|
Subroutine
process: called CC=4 SCAR=13.9
Pod
documented
| |||||||||||
| 26 | 1 | my ($self, $marc_record) = @_; | |||||||||
| 27 | |||||||||||
| 28 | 1 | my $record_id = $self->{'cb_record_id'}->($marc_record); | |||||||||
| 29 | 1 | my @record_errors; | |||||||||
| 30 | |||||||||||
| 31 | 1 | my @field_260 = $marc_record->field('260'); | |||||||||
| 32 | 1 | foreach my $field_260 (@field_260) { | |||||||||
| 33 | 1 | my @field_260_c = $field_260->subfield('c'); | |||||||||
| 34 | 1 | foreach my $field_260_c (@field_260_c) { | |||||||||
| 35 | 1 | push @record_errors, check_260c_year($self, $field_260_c, '260'); | |||||||||
| 36 | } | ||||||||||
| 37 | } | ||||||||||
| 38 | |||||||||||
| 39 | 1 | ▶ | if (@record_errors) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 1 | push @{$self->{'errors'}}, Data::MARC::Validator::Report::Plugin::Errors->new( | |||||||||
| 41 | 'errors' => \@record_errors, | ||||||||||
| 42 | 1 | 'filters' => $self->{'filters'}, | |||||||||
| 43 | 'record_id' => $record_id, | ||||||||||
| 44 | ); | ||||||||||
| 45 | } | ||||||||||
| 46 | |||||||||||
| 47 | 1 | return; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 3 | ▶ | sub version { | ||||||||
|
Subroutine
version: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 51 | 3 | my $self = shift; | |||||||||
| 52 | |||||||||||
| 53 | 3 | return $VERSION; | |||||||||
| 54 | } | ||||||||||
| 55 | |||||||||||
| 56 | 6 | 1; | |||||||||
| 57 | |||||||||||
| 58 | __END__ | ||||||||||