Class PHP_MARC

Description

PHP_MARC Class

Create a PHP_MARC class

Located in /packages/collections/lib/php-marc/php-marc.php (line 382)


	
			
Direct descendents
Class Description
PHP_MARC_YAZ PHP_MARC_YAZ class
Variable Summary
array $fields
string $ldr
array $warn
Method Summary
void append_fields (Field $field)
void delete_all (PHP_MARC_Field $field)
void delete_field (PHP_MARC_Field $field)
string|false ffield (string $tag, string $format)
PHP_MARC_Field|false field (string $spec)
array fields ([string $spec = ""])
string formatted ()
string|null leader ([string $ldr = ""])
void leader_lengths ( $reclen,  $baseaddr)
Record make_clone ()
void php_marc ()
string raw ()
PHP_MARC_Subfield|false subfield (string $field, string $subfield)
void warnings ()
array _build_dir ()
void _croak (string $msg)
void _sort_fields ()
string _warn (string $msg)
Variables
array $fields (line 392)

Contain all @link Field objects of the Record

string $ldr (line 397)

Leader of the Record

array $warn (line 402)

Array of warnings

Methods
append_fields (line 476)

Append field to existing

Given Field object will be appended to the existing list of fields. Field will be appended last and not in its "correct" location.

void append_fields (Field $field)
  • Field $field: The field to append
delete_all (line 616)

Delete field

Delete all occurances of a field

void delete_all (PHP_MARC_Field $field)
delete_field (line 602)

Delete Field

Delete the first occurance of the given field.

void delete_field (PHP_MARC_Field $field)
ffield (line 654)

Formatted representation of PHP_MARC_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|false ffield (string $tag, string $format)
  • string $tag: Field name
  • string $format: Format string
field (line 572)

Get specific field

Search for field in Record fields based on field name, e.g. 020

  • return: Return PHP_MARC_Field if found, otherwise false
PHP_MARC_Field|false field (string $spec)
  • string $spec: Field name
fields (line 553)

Return all PHP_MARC_Field objects matching criteria. If the criteria is omitted all fields will be returned

  • return: Array of PHP_MARC_Field objects
array fields ([string $spec = ""])
  • string $spec: Criteria
formatted (line 704)

Return formatted

Return the Record in a formatted fashion. Similar to the output of the formatted() function in MARC::Record in Perl

  • return: Formatted representation of MARC record
string formatted ()
leader (line 461)

Get/Set Leader

If argument specified, sets leader, otherwise gets leader. No validation on the specified leader is performed

  • return: Return leader in case requested.
string|null leader ([string $ldr = ""])
  • string $ldr: Leader
leader_lengths (line 539)

Set Leader lengths

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

void leader_lengths ( $reclen,  $baseaddr)
  • $reclen
  • $baseaddr
make_clone (line 628)

Clone record

Clone a record with all its Fields and subfields

  • return: Clone record
Record make_clone ()
php_marc (line 448)

Start function

Set all variables to defaults to create new PHP_MARC object

void php_marc ()
raw (line 684)

Return Raw

Return the Record in raw MARC format.

  • return: Raw MARC data
string raw ()
subfield (line 588)

Get subfield of PHP_MARC_Field object

Returns the value of a specific subfield of a given Field object

  • return: Return value of subfield if Field exists, otherwise false
PHP_MARC_Subfield|false subfield (string $field, string $subfield)
  • string $field: Name of field
  • string $subfield: Name of subfield
warnings (line 435)

Return an array of warnings

void warnings ()
_build_dir (line 490)

Build Record Directory

Generate the directory of the Record according to existing data.

  • return: Array ( $fields, $directory, $total, $baseaddress )
array _build_dir ()
_croak (line 415)

Croaking function

Similar to Perl's croak function, which ends parsing and raises an user error with a descriptive message.

void _croak (string $msg)
  • string $msg: The message to display
_sort_fields (line 723)

Sort fields

Sort all fields in record in appropriate manner. By default this is in numerically ascending order.

void _sort_fields ()
_warn (line 427)

Fuction to issue warnings

Warnings will not be displayed unless explicitly accessed, but all warnings issued during parse will be stored

  • return: Last added warning
string _warn (string $msg)
  • string $msg: Warning

Documentation generated on Wed, 05 Mar 2008 16:47:04 -0600 by phpDocumentor 1.3.1