<<

NAME

Koha::Util::MARC - utility class with routines for working with MARC records

METHODS

createMergeHash

Create a hash to use when merging MARC records

_createKey

Create a random value to set it into the input name

getAuthorityAuthorizedHeading

Retrieve the authorized heading from a MARC authority record

set_marc_field

    set_marc_field($record, $marcField, $value);

Set the value of $marcField to $value in $record. If the field exists, it will be updated. If not, it will be created.

Parameters

$record

MARC::Record object

$marcField

the MARC field to modify, a string in the form of 'XXX$y'

$value

the value

find_marc_info

    my $first = find_marc_info({ record => $marc, field => $field, subfield => $subfield, match => qr/regex/ });
    my @found = find_marc_info({ record => $marc, field => $field, subfield => $subfield, match => qr/regex/ });

    Returns first or all occurrences of field/subfield in record where regex matches.
    Subfield is not used for control fields.
    Match is optional.

strip_orgcode

    my $id = strip_orgcode( '(code) 123' ); # returns '123'

    Strips from starting left paren to first right paren and trailing whitespace.

oclc_number

    my $id = oclc_number( $record );

    Based on applying strip_orgcode on first occurrence of find_marc_info
    with orgcode matching regex in 035$a.

<<