Class MARC

Description

The main MARC class enables you to read MARC records from a stream or string.

Located in /MARC.php (line 134)


	
			
Variable Summary
integer $_pointer
array $_raw
PEAR::ErrorStack $_stack
Method Summary
PEAR_Error __construct (string $in, [int $source = MARC_SOURCE_FILE])
string nextRaw ()
int numRecords ()
Variables
integer $_pointer (line 156)

Current position in the array of records

  • access: protected
array $_raw (line 142)

Array containing raw records

  • access: protected
PEAR::ErrorStack $_stack (line 149)

Error stack

  • access: protected
Methods
Constructor __construct (line 180)

Read in MARC records

This function reads in MARC record files or strings that contain one or more MARC records.

  1.  <?php
  2.  // Retrieve MARC records from a file
  3.   $journals new MARC('journals.mrc'MARC_SOURCE_FILE);
  4.  
  5.  // Retrieve MARC records from a string (e.g. Z39 query results)
  6.   $monographs new MARC($raw_marcMARC_SOURCE_STRING);
  7.  ?>

  • return: Returns an error if MARC records cannot be read
PEAR_Error __construct (string $in, [int $source = MARC_SOURCE_FILE])
  • string $in: Name of the file, or a raw MARC string
  • int $source: Source of the input, either MARC_SOURCE_FILE or MARC_SOURCE_STRING
next (line 263)

Return next MARC_Record object

Decode the next raw MARC record and return

  • return: A MARC_Record object, or false if there are no more records
MARC_Record next ()
nextRaw (line 221)

Return the next raw MARC record

Returns the next raw MARC record, unless all records already have been read.

  • return: Either a raw record or false
string nextRaw ()
numRecords (line 401)

Get the number of records available in this Record

  • return: The number of records
int numRecords ()

Documentation generated on Mon, 14 Aug 2006 18:59:28 -0400 by phpDocumentor 1.3.0RC6