You are here

public function Field::raw in Bibliography Module 7

Same name and namespace in other branches
  1. 6.2 modules/marcParse/php-marc.php \Field::raw()
  2. 6 marcParse/php-marc.php \Field::raw()
  3. 7.2 modules/marcParse/php-marc.php \Field::raw()

Return Field in Raw MARC.

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

Return value

string Raw MARC

File

modules/marcParse/php-marc.php, line 1081
@package PHP-MARC

Class

Field
Field Class Create a MARC Field object.

Code

public function raw() {
  if ($this->is_control) {
    return $this->data . END_OF_FIELD;
  }
  else {
    $subfields = array();
    foreach ($this->subfields as $subfield => $value) {
      $subfields[] = SUBFIELD_INDICATOR . $subfield . $value;
    }
    return $this->ind1 . $this->ind2 . implode("", $subfields) . END_OF_FIELD;
  }
}