<<

NAME

Koha::BiblioUtils::Iterator - iterates over biblios provided by a DBIx::Class::ResultSet

DESCRIPTION

This provides an iterator that gives the MARC::Record of each biblio that's returned by a DBIx::Class::ResultSet that provides a biblionumber, and marc or marcxml column from the biblioitems table.

SYNOPSIS

  use Koha::BiblioUtils::Iterator;
  my $rs = $schema->resultset('biblioitems');
  my $iterator = Koha::BiblioUtils::Iterator->new($rs);
  while (my $record = $iterator->next()) {
      // do something with $record
  }

METHODS

new

    my $it = new($sth, option => $value, ...);

Takes a ResultSet to iterate over, and gives you an iterator on it. Optional options may be specified.

Options

items

Set to true to include item data in the resulting MARC record.

next()

In a scalar context, provides the next MARC::Record from the ResultSet, or undef if there are no more.

In a list context it will provide ($biblionumber, $record).

<<