You are here

public function Field::add_subfields in Bibliography Module 7

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

Add subfield.

Appends subfields to existing fields last, not in "correct" plase.

Parameters

array Subfield data:

Return value

string Returns warnings if issued during parse.

1 call to Field::add_subfields()
Field::__construct in modules/marcParse/php-marc.php
Field init function.

File

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

Class

Field
Field Class Create a MARC Field object.

Code

public function add_subfields() {

  // Process arguments.
  $args = func_get_args();
  if (count($args) == 1 && is_array($args[0])) {
    $args = $args[0];
  }

  // Add subfields, is appropriate.
  if ($this->is_control) {
    return $this
      ->_warn("Subfields allowed only for tags bigger or equal to 10");
  }
  else {
    $this->subfields = array_merge($this->subfields, $args);
  }
  return count($args) / 2;
}