<<

NAME

Koha::Metadata - Koha Metadata Object class

API

Class methods

record

my $record = $metadata->record;

Returns an object representing the metadata record. The expected record type corresponds to this table:

    -------------------------------
    | format     | object type    |
    -------------------------------
    | marcxml    | MARC::Record   |
    -------------------------------

    $record = $biblio->metadata->record({
        {
            embed_items => 0|1
            itemnumbers => $itemnumbers,
            opac        => $opac
        }
    );

    Koha::Biblio::Metadata::record(
        {
            record       => $record,
            embed_items  => 1,
            biblionumber => $biblionumber,
            itemnumbers  => $itemnumbers,
            opac         => $opac
        }
    );

Given a MARC::Record object containing a bib record, modify it to include the items attached to it as 9XX per the bib's MARC framework. if $itemnumbers is defined, only specified itemnumbers are embedded.

If $opac is true, then opac-relevant suppressions are included.

If opac filtering will be done, patron should be passed to properly override if necessary.

Error handling

If an unsupported format is found, it throws a Koha::Exceptions::Metadata exception.
If it fails to create the record object, it throws a Koha::Exceptions::Metadata::Invalid exception.

record_strip_nonxml

my $record = $metadata->record_strip_nonxml;

This subroutine is intended for cases where we encounter a record that cannot be parsed, but want to make a good effort to present the record (for harvesting, deletion, editing) rather than throwing an exception

Will return undef if the record cannot be built

source_allows_editing

    if ( $metadata->source_allows_editing ) { ... }

Returns a boolean denoting whether the metadata's record source allows it to be edited.

record_source

    my $record_source = $metadata->record_source;

Returns a Koha::RecordSource object for the linked record source.

Internal methods

_embed_items

_type

<<