Class MARC_Record

Description

Represents a single MARC record

A MARC record contains a leader and zero or more fields held within a linked list structure. Fields are represented by MARC_Data_Field objects.

Located in /MARC.php (line 423)


	
			
Variable Summary
string $_leader
PEAR::ErrorStack $_stack
Method Summary
true __construct ()
MARC_Field addField (MARC_Field $newField, [int $mode = MARC_LINK_ADD_APPEND], [MARC_Field $existingField = null])
int deleteAll (string $tag)
true deleteField (MARC_Data_Field $field)
PEAR_ErrorStack getErrors ()
array getFields ([string $spec = null])
string getFormattedField (string $tag, string $format)
string getLeader ()
MARC_Subfield|array getSubfield (MARC_Data_Field $field, string $code)
string setLeader (string $leader)
true setLeaderLengths (int $reclen, int $baseaddr)
string toRaw ()
string __toString ()
Variables
MARC_Linked_List $_fields (line 430)

Contains a linked list of MARC_Data_Field objects for this Record

  • access: protected
string $_leader (line 436)

Record leader

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

Error stack

  • access: protected
Methods
Constructor __construct (line 454)

Start function

Set all variables to defaults to create new MARC_Record object

true __construct ()
addField (line 523)

Adds field to MARC record

Adds a MARC_Control_Field or MARC_Data_Field object to the existing list of fields according to the specified mode.

  • return: the new MARC_Field object if the operation succeeded, or a PEAR_Error object if the operation failed
MARC_Field addField (MARC_Field $newField, [int $mode = MARC_LINK_ADD_APPEND], [MARC_Field $existingField = null])
  • MARC_Field $newField: The field to add
  • int $mode: specifies how to add the field
  • MARC_Field $existingField: specifies the reference field for locating the new field
deleteAll (line 694)

Delete all occurrences of a field matching a tag name from the record.

  • return: number of fields that were deleted
int deleteAll (string $tag)
  • string $tag: tag for the fields to be deleted
deleteField (line 680)

Deletes the requested field from the record.

true deleteField (MARC_Data_Field $field)
duplicate (line 713)

Duplicate a record with all its fields and subfields

  • return: Return the duplicated record
MARC_Record duplicate ()
getErrors (line 470)

Get errors (if any) for this object

Returns the error stack.

  • return: returns the error stack
PEAR_ErrorStack getErrors ()
getFields (line 639)

Return an array containing all MARC_Data_Field or MARC_Control_Field objects * that match the specified tag name.

If the tag name is omitted all fields will be returned.

  • return: MARC_Data_Field or MARC_Control_Field objects that match the requested tag name
array getFields ([string $spec = null])
  • string $spec: tag name (you can use a PCRE)
getFormattedField (line 741)

Formatted representation of MARC_Data_Field

Format a Field with a sprintf()-like formatting syntax. The formatting codes are the names of the subfields of the field.

  • return: Return formatted string if Field exists, otherwise False
string getFormattedField (string $tag, string $format)
  • string $tag: Field name
  • string $format: Format string
getLeader (line 487)

Get MARC leader

Returns the leader for the MARC record. No validation on the specified leader is performed

  • return: returns the leader
string getLeader ()
getSubfield (line 667)

Retrieve subfields from a MARC_Data_Field object

From the specified Field object, return all subfields with a matching code

MARC_Subfield|array getSubfield (MARC_Data_Field $field, string $code)
  • MARC_Data_Field $field: field object
  • string $code: Code of subfield (you can use a PCRE)
setLeader (line 503)

Set MARC record leader

Sets the leader for the MARC record. No validation on the specified leader is performed.

  • return: returns the leader
string setLeader (string $leader)
  • string $leader: Leader
setLeaderLengths (line 620)

Set MARC record leader lengths

Set the Leader lengths of the record according to defaults specified in http://www.loc.gov/marc/bibliographic/ecbdleaderd.html

true setLeaderLengths (int $reclen, int $baseaddr)
  • int $reclen
  • int $baseaddr
toRaw (line 773)

Return the Record in raw MARC format.

  • return: Raw MARC data
string toRaw ()
__toString (line 793)

Return the MARC record in a pretty printed string

Return the MARC record in a pretty printed string.

  • return: Formatted representation of MARC record
string __toString ()

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