Class MARC_Data_Field

Description

The MARC_Data_Field class represents a single field in a MARC record.

A MARC field consists of a tag name, two indicators which may be null, and zero or more subfields represented by MARC_Subfield objects. Subfields are held within a linked list structure.

Located in /MARC.php (line 966)

MARC_Link
   |
   --MARC_Field
      |
      --MARC_Data_Field
Variable Summary
Method Summary
string __construct (string $tag, array $subfields, [string $ind1 = null], [string $ind2 = null])
void __destruct ()
MARC_Subfield addSubfield (MARC_Subfield $newSubfield, [int $mode = MARC_LINK_ADD_APPEND], [MARC_Subfield $existingSubfield = null])
int addSubfields (array $subfields)
void delete ()
void deleteSubfield ( $subfield)
Field duplicate ()
string getIndicator (int $ind)
MARC_Subfield|array getSubfield (string $code)
bool isEmpty ()
string setIndicator (int $ind, string $value)
string toRaw ()
string __toString ()
Variables
string $_ind1 (line 973)

Value of the first indicator

  • access: protected
string $_ind2 (line 979)

Value of the second indicator

  • access: protected
MARC_Linked_List $_subfields (line 985)

Linked list of subfields

  • access: protected

Inherited Variables

Inherited from MARC_Field

MARC_Field::$_tag

Inherited from MARC_Link

MARC_Link::$_next
MARC_Link::$_previous
MARC_Link::$_stack
Methods
Constructor __construct (line 1001)

Field init function

Create a new MARC_Data_Field object from passed arguments

  • return: Returns warnings, if any, issued during parse
string __construct (string $tag, array $subfields, [string $ind1 = null], [string $ind2 = null])
  • string $tag: tag
  • array $subfields: array of MARC_Subfield objects
  • string $ind1: first indicator
  • string $ind2: second indicator

Redefinition of:
MARC_Field::__construct()
MARC_Field constructor
Destructor __destruct (line 1021)

Destroys the data field

void __destruct ()

Redefinition of:
MARC_Field::__destruct()
Destroys the data field
addSubfield (line 1069)

Add subfield to a field in a MARC record

Given MARC_Subfield object will be added to the existing list of fields.

  • return: the new MARC_Subfield object if the operation succeeded, or a PEAR_Error object if the operation failed
MARC_Subfield addSubfield (MARC_Subfield $newSubfield, [int $mode = MARC_LINK_ADD_APPEND], [MARC_Subfield $existingSubfield = null])
  • MARC_Subfield $newSubfield: subfield to add
  • int $mode: where to add the new subfield
  • MARC_Subfield $existingSubfield: reference location for the new subfield
addSubfields (line 1111)

Adds an array of subfields to a MARC_Data_Field object

Appends subfields to existing subfields in the order in which they appear in the array. For finer grained control of the subfield order, use addSubfield().

  • return: returns the number of subfields that were added
int addSubfields (array $subfields)
delete (line 1033)

Destroys the data field

void delete ()
deleteSubfield (line 1131)
void deleteSubfield ( $subfield)
  • $subfield
duplicate (line 1243)

Duplicate field

  • return: Duplicated field object
Field duplicate ()
getAllSubfields (line 1231)

Returns an array containing all subfields in this field

MARC_Linked_List getAllSubfields ()
getIndicator (line 1144)

Get values of indicators

  • return: returns indicator value if it exists, otherwise false
string getIndicator (int $ind)
  • int $ind: number of the indicator (1 or 2)
getSubfield (line 1194)

Returns the MARC_Subfield object, or array of objects, for a requested code

MARC_Subfield|array getSubfield (string $code)
  • string $code: subfield code for which the MARC_Subfield is retrieved
isEmpty (line 1267)

Is empty

Checks if the field is empty. Criteria is that it has at least one subfield with data

  • return: Returns true if the field is empty, otherwise false
bool isEmpty ()

Redefinition of:
MARC_Field::isEmpty()
Is empty
setIndicator (line 1165)

Set value of an indicator

  • return: returns indicator value if it exists, otherwise false
string setIndicator (int $ind, string $value)
  • int $ind: number of the indicator (1 or 2)
  • string $value: value of the indicator
toRaw (line 1318)

Return Field in Raw MARC

Return the Field formatted in Raw MARC for saving into MARC files

  • return: Raw MARC
string toRaw ()

Redefinition of:
MARC_Field::toRaw()
Return field in raw MARC format (stub)
__toString (line 1292)

Return Field formatted

Return Field as a formatted string.

  • return: Formatted output of Field
string __toString ()

Redefinition of:
MARC_Field::__toString()
Return Field formatted

Inherited Methods

Inherited From MARC_Field

MARC_Field::__construct()
MARC_Field::getTag()
MARC_Field::isEmpty()
MARC_Field::setTag()
MARC_Field::toRaw()
MARC_Field::__destruct()
MARC_Field::__toString()

Inherited From MARC_Link

MARC_Link::__construct()
MARC_Link::getErrors()
MARC_Link::next()
MARC_Link::previous()
MARC_Link::setNext()
MARC_Link::setPrevious()
MARC_Link::__destruct()

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