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

Class: File_MARCFlat

Source Location: /File_MARC-0.2.3/MARCFLAT.php

Class Overview


The main File_MARCFlat class enables you to return File_MARC_Record objects from a stream or string of flat text MARC data.


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods


Class Details

[line 60]
The main File_MARCFlat class enables you to return File_MARC_Record objects from a stream or string of flat text MARC data.


[ Top ]


Class Variables

$counter =

[line 96]

Counter for MARCXML records in a collection
  • Access: protected

Type:   int


[ Top ]

$source =

[line 82]

Source containing raw records
  • Access: protected

Type:   resource


[ Top ]

$type =

[line 89]

Source type (SOURCE_FILE or SOURCE_STRING)
  • Access: protected

Type:   int


[ Top ]



Method Detail

__construct (Constructor)   [line 117]

File_MARCFlat __construct( string $source, [int $type = self::SOURCE_FILE])

Read in MARC records

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

  1.  // Retrieve MARC records from a file
  2.  $journals = new File_MARCFLAT('journals.mrc'SOURCE_FILE);
  3.  
  4.  // Retrieve MARC records from a string (e.g. Z39 query results)
  5.  $monographs = new File_MARCFLAT($raw_marcSOURCE_STRING);


Parameters:

string   $source   —  Name of the file, or a MARC string
int   $type   —  Source of the input, either SOURCE_FILE or SOURCE_STRING

[ Top ]

next   [line 202]

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 157]

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 ]


Documentation generated on Mon, 11 Mar 2019 15:26:07 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.