<<

NAME

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

DESCRIPTION

This provides an iterator over a DBIx::Class::ResultSet that contains a biblionumber column. Returns a MARC::Record in scalar context. Returns biblionumber and marc in list context.

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).

<<