You are here

function Record::field in Bibliography Module 6.2

Same name and namespace in other branches
  1. 6 marcParse/php-marc.php \Record::field()
  2. 7 modules/marcParse/php-marc.php \Record::field()
  3. 7.2 modules/marcParse/php-marc.php \Record::field()

Get specific field

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

Parameters

string Field name:

Return value

Field|false Return Field if found, otherwise false

2 calls to Record::field()
Record::ffield in modules/marcParse/php-marc.php
Formatted representation of Field
Record::subfield in modules/marcParse/php-marc.php
Get subfield of Field object

File

modules/marcParse/php-marc.php, line 541

Class

Record
Record Class Create a MARC Record class

Code

function field($spec) {
  if (array_key_exists($spec, $this->fields)) {
    return $this->fields[$spec][0];
  }
  else {
    return false;
  }
}