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

Class: File_MARC_Data_Field

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

Class Overview

SplDoublyLinkedList
   |
   --File_MARC_List
      |
      --File_MARC_Field
         |
         --File_MARC_Data_Field

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


Author(s):

Variables

Methods


Inherited Variables

Inherited Methods

Class: File_MARC_Field

File_MARC_Field::__construct()
File_MARC_Field constructor
File_MARC_Field::formatField()
Pretty print a MARC_Field object without tags, indicators, etc.
File_MARC_Field::getTag()
Returns the tag for this File_MARC_Field object
File_MARC_Field::isControlField()
Is control field
File_MARC_Field::isDataField()
Is data field
File_MARC_Field::isEmpty()
Is empty
File_MARC_Field::setTag()
Sets the tag for this File_MARC_Field object
File_MARC_Field::toRaw()
Return field in raw MARC format (stub)
File_MARC_Field::__destruct()
Destroys the data field
File_MARC_Field::__toString()
Return Field formatted

Class: File_MARC_List

File_MARC_List::appendNode()
Adds a node onto the linked list.
File_MARC_List::deleteNode()
Deletes a node from the linked list.
File_MARC_List::getPosition()
Return position of the subfield
File_MARC_List::insertNode()
Inserts a node into the linked list, based on a reference node that already exists in the list.
File_MARC_List::key()
Returns the tag for a File_MARC_Field object, or the code for a File_MARC_Subfield object.
File_MARC_List::prependNode()
Adds a node to the start of the linked list.
File_MARC_List::setPosition()
Sets position of the subfield

Class: SplDoublyLinkedList (Internal Class)

add ( $index, $newval )
bottom ( )
count ( )
current ( )
getIteratorMode ( )
isEmpty ( )
key ( )
next ( )
offsetExists ( $index )
offsetGet ( $index )
offsetSet ( $index, $newval )
offsetUnset ( $index )
pop ( )
prev ( )
push ( $value )
rewind ( )
serialize ( )
setIteratorMode ( $flags )
shift ( )
top ( )
unserialize ( $serialized )
unshift ( $value )
valid ( )

Class Details

[line 54]
The File_MARC_Data_Field class represents a single field in a MARC record.

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



[ Top ]


Class Variables

$ind1 =

[line 62]

Value of the first indicator
  • Access: protected

Type:   string


[ Top ]

$ind2 =

[line 68]

Value of the second indicator
  • Access: protected

Type:   string


[ Top ]

$subfields =

[line 74]

Linked list of subfields
  • Access: protected

Type:   File_MARC_List


[ Top ]



Method Detail

__construct (Constructor)   [line 101]

File_MARC_Data_Field __construct( string $tag, [array $subfields = null], [string $ind1 = null], [string $ind2 = null])

File_MARC_Data_Field constructor

Create a new File_MARC_Data_Field object. The only required parameter is a tag. This enables programs to build up new fields programmatically.

  1.  // Example: Create a new data field
  2.  
  3.  // We can optionally create an array of subfields first
  4.  $subfields[= new File_MARC_Subfield('a''Scott, Daniel.');
  5.  
  6.  // Create the new 100 field complete with a _a subfield and an indicator
  7.  $new_field = new File_MARC_Data_Field('100'$subfields0null);


Overrides File_MARC_Field::__construct() (File_MARC_Field constructor)

Parameters:

string   $tag   —  tag
array   $subfields   —  array of File_MARC_Subfield objects
string   $ind1   —  first indicator
string   $ind2   —  second indicator

[ Top ]

__destruct (Destructor)   [line 121]

void __destruct( )

Destroys the data field

Overrides File_MARC_Field::__destruct() (Destroys the data field)
[ Top ]

addSubfields   [line 238]

int addSubfields( array $subfields)

Adds an array of subfields to a File_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 appendSubfield(), prependSubfield(), or insertSubfield() to add each subfield individually.

  • Return: returns the number of subfields that were added

Parameters:

array   $subfields   —  array of File_MARC_Subfield objects

[ Top ]

appendSubfield   [line 180]

File_MARC_Subfield appendSubfield( File_MARC_Subfield $new_subfield)

Appends subfield to subfield list

Adds a File_MARC_Subfield object to the end of the existing list of subfields.

  • Return: the new File_MARC_Subfield object

Parameters:

File_MARC_Subfield   $new_subfield   —  The subfield to add

[ Top ]

delete   [line 136]

true delete( )

Destroys the data field

[ Top ]

deleteSubfield   [line 268]

void deleteSubfield( File_MARC_Subfield $subfield)

Delete a subfield from the field.

Parameters:

File_MARC_Subfield   $subfield   —  The subfield to delete

[ Top ]

getContents   [line 482]

string getContents( [string $joinChar = ''])

Return fields data content as joined string

Return all the fields data content as a joined string

  • Return: Joined string

Parameters:

string   $joinChar   —  A string used to join the data conntent. Default is an empty string

[ Top ]

getIndicator   [line 282]

string getIndicator( int $ind)

Get the value of an indicator
  • Return: returns indicator value if it exists, otherwise false

Parameters:

int   $ind   —  number of the indicator (1 or 2)

[ Top ]

getSubfield   [line 338]

File_MARC_Subfield getSubfield( [string $code = null], [bool $pcre = null])

Returns the first subfield that matches a requested code.
  • Return: returns the first subfield that matches $code, or false if no codes match $code

Parameters:

string   $code   —  subfield code for which the File_MARC_Subfield is retrieved
bool   $pcre   —  if true, then match as a regular expression

[ Top ]

getSubfields   [line 370]

File_MARC_List|array getSubfields( [string $code = null], [bool $pcre = null])

Returns an array of subfields that match a requested code, or a File_MARC_List that contains all of the subfields if the requested code is null.
  • Return: returns a linked list of all subfields if $code is null, an array of File_MARC_Subfield objects if one or more subfields match, or an empty array if no codes match $code

Parameters:

string   $code   —  subfield code for which the File_MARC_Subfield is retrieved
bool   $pcre   —  if true, then match as a regular expression

[ Top ]

insertSubfield   [line 218]

File_MARC_Subfield insertSubfield( File_MARC_Subfield $new_field, File_MARC_Subfield $existing_field, [bool $before = false])

Inserts a field in the MARC record relative to an existing field

Inserts a File_MARC_Subfield object before or after an existing subfield.

  • Return: The new subfield

Parameters:

File_MARC_Subfield   $new_field   —  The subfield to add
File_MARC_Subfield   $existing_field   —  The target subfield
bool   $before   —  Insert the subfield before the existing subfield if true; after the existing subfield if false

[ Top ]

isEmpty   [line 403]

bool isEmpty( )

Checks if the field is empty.

Checks if the field is empty. If the field has at least one subfield with data, it is not empty.

  • Return: Returns true if the field is empty, otherwise false

Overrides File_MARC_Field::isEmpty() (Is empty)
[ Top ]

prependSubfield   [line 198]

File_MARC_Subfield prependSubfield( File_MARC_Subfield $new_subfield)

Prepends subfield to subfield list

Adds a File_MARC_Subfield object to the start of the existing list of subfields.

  • Return: the new File_MARC_Subfield object

Parameters:

File_MARC_Subfield   $new_subfield   —  The subfield to add

[ Top ]

setIndicator   [line 305]

string setIndicator( int $ind, string $value)

Set the value of an indicator
  • Return: returns indicator value if it exists, otherwise false

Parameters:

int   $ind   —  number of the indicator (1 or 2)
string   $value   —  value of the indicator

[ Top ]

toRaw   [line 459]

string toRaw( )

Return Field in Raw MARC

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

  • Return: Raw MARC

Overrides File_MARC_Field::toRaw() (Return field in raw MARC format (stub))
[ Top ]

__toString   [line 434]

string __toString( )

Return Field formatted

Return Field as a formatted string.

  • Return: Formatted output of Field

Overrides File_MARC_Field::__toString() (Return Field formatted)
[ Top ]


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