File_MARC
[ class tree: File_MARC ] [ index: File_MARC ] [ all elements ]

Class: File_MARC

Source Location: /File_MARC-1.4.1/File/MARC.php

Class Overview

File_MARCBASE
   |
   --File_MARC

The main File_MARC class enables you to return File_MARC_Record objects from a stream or string.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: File_MARCBASE

File_MARCBASE::__construct()
Read in MARCXML records
File_MARCBASE::getXMLWriter()
Returns the XMLWriter object
File_MARCBASE::toXMLFooter()
Returns the MARCXML collection footer
File_MARCBASE::toXMLHeader()
Initializes the MARCXML output of a record or collection of records

Class Details

[line 64]
The main File_MARC class enables you to return File_MARC_Record objects from a stream or string.


[ Top ]


Class Variables

$source =

[line 116]

Source containing raw records
  • Access: protected

Type:   resource


[ Top ]

$type =

[line 123]

Source type (SOURCE_FILE or SOURCE_STRING)
  • Access: protected

Type:   int


[ Top ]

$xmlwriter =

[line 130]

XMLWriter for writing collections
  • Access: protected

Type:   XMLWriter
Overrides:   Array


[ Top ]



Method Detail

next   [line 236]

File_MARC_Record next( )

Return next File_MARC_Record object

Decodes the next raw MARC record and returns the File_MARC_Record object.

  1.  <?php
  2.  // Retrieve a set of MARC records from a file
  3.  $journals = new File_MARC('journals.mrc'SOURCE_FILE);
  4.  
  5.  // Iterate through the retrieved records
  6.  while ($record $journals->next()) {
  7.      print $record;
  8.      print "\n";
  9.  }
  10.  
  11.  ?>

  • Return: next record, or false if there are no more records

[ Top ]

nextRaw   [line 190]

string nextRaw( )

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

[ Top ]

__construct (Constructor)   [line 154]

File_MARC __construct( string $source, [int $type = self::SOURCE_FILE], [string $record_class = null])

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 File_MARC('journals.mrc'SOURCE_FILE);
  4.  
  5.  // Retrieve MARC records from a string (e.g. Z39 query results)
  6.  $monographs = new File_MARC($raw_marcSOURCE_STRING);
  7.  ?>


Overrides File_MARCBASE::__construct() (Read in MARCXML records)

Parameters:

string   $source   —  Name of the file, or a raw MARC string
int   $type   —  Source of the input, either SOURCE_FILE or SOURCE_STRING
string   $record_class   —  Record class, defaults to File_MARC_Record

[ Top ]


Documentation generated on Wed, 13 Nov 2019 12:37:08 -0500 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.