VuFind-Marc API Documentation

MarcCollection
in package
implements Iterator

MARC collection class.

Tags
category

VuFind

author

Ere Maijala ere.maijala@helsinki.fi

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Wiki

Interfaces, Classes, Traits and Enums

Iterator

Table of Contents

$position  : int
Iteration position
$records  : array<string|int, mixed>
Records in the collection
$serializations  : array<string|int, mixed>
Supported serialization formats
__construct()  : mixed
Constructor
current()  : mixed
Iterator: Return current record.
key()  : mixed
Iterator: Return current key.
next()  : void
Iterator: Advance to the next record.
rewind()  : void
Iterator: Rewind to the beginning.
setData()  : void
Set MARC record data
valid()  : bool
Iterator: Check if current position is valid.

Properties

$records

Records in the collection

protected array<string|int, mixed> $records = []

$serializations

Supported serialization formats

protected array<string|int, mixed> $serializations = ['ISO2709' => \VuFind\Marc\Serialization\Iso2709::class, 'MARCXML' => \VuFind\Marc\Serialization\MarcXml::class, 'JSON' => \VuFind\Marc\Serialization\MarcInJson::class]

Methods

__construct()

Constructor

public __construct([string $data = '' ]) : mixed
Parameters
$data : string = ''

MARC record collection in MARCXML or ISO2709 format

Return values
mixed

current()

Iterator: Return current record.

public current() : mixed
Return values
mixed

key()

Iterator: Return current key.

public key() : mixed
Return values
mixed

next()

Iterator: Advance to the next record.

public next() : void
Return values
void

rewind()

Iterator: Rewind to the beginning.

public rewind() : void
Return values
void

setData()

Set MARC record data

public setData(string $data) : void
Parameters
$data : string

MARC record in MARCXML or ISO2709 format

Tags
throws
Exception
Return values
void

valid()

Iterator: Check if current position is valid.

public valid() : bool
Return values
bool

Search results