VuFind-Marc API Documentation

MarcCollectionFile
in package
implements Iterator

MARC collection class for streaming a file.

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

$messageCallback  : callable
Message callback
$position  : int
Iteration position
$record  : string
Current record
$serializations  : array<string|int, mixed>
Supported serialization formats
$stream  : SerializationFileInterface
Serialized format stream
__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.
setFile()  : void
Set MARC record file
valid()  : bool
Iterator: Check if current position is valid.

Properties

$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 $file = '' ][, callable $messageCallback = null ]) : mixed
Parameters
$file : string = ''

MARC record collection file in MARCXML or ISO2709 format

$messageCallback : callable = null

Callback triggered for any messages with message string and error level (similar to https://www.php.net/manual/en/function.error-reporting.php)

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

setFile()

Set MARC record file

public setFile(string $file) : void
Parameters
$file : string

MARC record collection file 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