<<

NAME

Koha::BiblioUtils - contains fundamental biblio-related functions

DESCRIPTION

This contains functions for normal operations on biblio records.

Note: really, C4::Biblio does the main functions, but the Koha namespace is the new thing that should be used.

FUNCTIONS

new

    my $biblio = Koha::BiblioUtils->new($marc_record, [$biblionumber]);

Creates an instance of Koha::BiblioUtils based on the marc record. If known, the biblionumber can be provided too.

get_from_biblionumber

    my $biblio = Koha::BiblioUtils->get_from_biblionumber($biblionumber, %options);

This will give you an instance of Koha::BiblioUtils that is the biblio that you requested.

Options are:

$item_data

If true, then the item data will be merged into the record when it's loaded.

It will return undef if the biblio doesn't exist.

get_all_biblios_iterator

    my $it = Koha::BiblioUtils->get_all_biblios_iterator(%options);

This will provide an iterator object that will, one by one, provide the Koha::BiblioUtils of each biblio. This will include the item data.

The iterator is a Koha::MetadataIterator object.

Possible options are:

slice

slice may be defined as a hash of two values: index and count. index is the slice number to process and count is total number of slices. With this information the iterator returns just the given slice of records instead of all.

get_marc_biblio

    my $marc = Koha::BiblioUtils->get_marc_biblio($bibnum, %options);

This non-class function fetches the MARC::Record for the given biblio number. Nothing is returned if the biblionumber couldn't be found (or it somehow has no MARC data.)

Options are:

item_data

If set to true, item data is embedded in the record. Default is to not do this.

<<