VuFind-Marc API Documentation

Iso2709 extends AbstractSerializationFile
in package
implements SerializationInterface

ISO2709 exchange format support 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

SerializationInterface
MARC serialization interface.

Table of Contents

END_OF_FIELD  = "\x1e"
END_OF_RECORD  = "\x1d"
LEADER_LEN  = 24
MAX_LENGTH  = 99999
SUBFIELD_INDICATOR  = "\x1f"
$file  : resource
Serialized record file handle
$messageCallback  : callable
Message callback
canParse()  : bool
Check if this class can parse the given MARC string
canParseCollection()  : bool
Check if the serialization class can parse the given MARC collection string
canParseCollectionFile()  : bool
Check if the serialization class can parse the given MARC collection file
collectionFromString()  : array<string|int, mixed>
Parse MARC collection from a string into an array
fromString()  : array<string|int, mixed>
Parse an ISO2709 string
getNextRecord()  : string
Get next record from the file or an empty string on EOF
openCollectionFile()  : void
Open a collection file
rewind()  : void
Rewind the collection file
setMessageCallback()  : void
Set message callback
toString()  : string
Convert record to an ISO2709 string
message()  : void
Output a message

Constants

END_OF_FIELD

public mixed END_OF_FIELD = "\x1e"

END_OF_RECORD

public mixed END_OF_RECORD = "\x1d"

LEADER_LEN

public mixed LEADER_LEN = 24

MAX_LENGTH

public mixed MAX_LENGTH = 99999

SUBFIELD_INDICATOR

public mixed SUBFIELD_INDICATOR = "\x1f"

Properties

$file

Serialized record file handle

protected resource $file = null

Methods

canParse()

Check if this class can parse the given MARC string

public static canParse(string $marc) : bool
Parameters
$marc : string

MARC

Return values
bool

canParseCollection()

Check if the serialization class can parse the given MARC collection string

public static canParseCollection(string $marc) : bool
Parameters
$marc : string

MARC

Return values
bool

canParseCollectionFile()

Check if the serialization class can parse the given MARC collection file

public static canParseCollectionFile(string $file) : bool
Parameters
$file : string

File name

Return values
bool

collectionFromString()

Parse MARC collection from a string into an array

public static collectionFromString(string $collection) : array<string|int, mixed>
Parameters
$collection : string

MARC record collection in the format supported by the serialization class

Tags
throws
Exception
Return values
array<string|int, mixed>

fromString()

Parse an ISO2709 string

public static fromString(string $marc) : array<string|int, mixed>
Parameters
$marc : string

ISO2709

Tags
throws
Exception
Return values
array<string|int, mixed>

getNextRecord()

Get next record from the file or an empty string on EOF

public getNextRecord() : string
Tags
throws
Exception
Return values
string

openCollectionFile()

Open a collection file

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

File name

Tags
throws
Exception
Return values
void

rewind()

Rewind the collection file

public rewind() : void
Tags
throws
Exception
Return values
void

setMessageCallback()

Set message callback

public setMessageCallback(callable $callback) : void
Parameters
$callback : callable

Message callback

Return values
void

toString()

Convert record to an ISO2709 string

public static toString(array<string|int, mixed> $record) : string
Parameters
$record : array<string|int, mixed>

Record data

Return values
string

message()

Output a message

protected message(string $msg, int $level) : void
Parameters
$msg : string

Message

$level : int

Error level (see https://www.php.net/manual/en/function.error-reporting.php)

Return values
void

Search results