function Field::update in Bibliography Module 7.2
Same name and namespace in other branches
- 6.2 modules/marcParse/php-marc.php \Field::update()
- 6 marcParse/php-marc.php \Field::update()
- 7 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 895
Class
- Field
- Field Class Create a MARC Field object
Code
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;
}
}
}
}