You are here

function Field::add_subfields in Bibliography Module 6

Same name and namespace in other branches
  1. 6.2 modules/marcParse/php-marc.php \Field::add_subfields()
  2. 7 modules/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 string Returns warnings if issued during parse.

1 call to Field::add_subfields()
Field::field in marcParse/php-marc.php
* Field init function * * Create a new Field object from passed arguments *

File

marcParse/php-marc.php, line 800

Class

Field
Field Class Create a MARC Field object

Code

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;
}