You are here

public function Field::update in Bibliography Module 7

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

Update Field.

Update Field with given array of arguments.

Parameters

array Array of key->value pairs of data:

File

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

Class

Field
Field Class Create a MARC Field object.

Code

public function update() {

  // Process arguments.
  $args = func_get_args();
  if (count($args) == 1 && is_array($args[0])) {
    $args = $args[0];
  }
  if ($this->is_control) {
    $this->data = array_shift($args);
  }
  else {
    foreach ($args as $subfield => $value) {
      if ($subfield == "ind1") {
        $this->ind1 = $value;
      }
      elseif ($subfield == "ind2") {
        $this->ind2 = $value;
      }
      else {
        $this->subfields[$subfield] = $value;
      }
    }
  }
}