MarcCollection
in package
implements
Iterator
MARC collection class.
Tags
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
$position
Iteration position
protected
int
$position
= 0
$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
Return values
void —valid()
Iterator: Check if current position is valid.
public
valid() : bool