/** * Creates a new LinkedItem for 78x fields * * @param DataField $datafield */ public function __construct(DataField $datafield) { foreach ($datafield->subfield() as $subfield) { switch ($subfield->code) { // $a - Main entry heading (NR) case 'b': // $b - Edition (NR) $this->edition = $subfield->value; break; // $c - Qualifying information (NR) // $d - Place, publisher, and date of publication (NR) // $g - Related parts (R) // $h - Physical description (NR) // $i - Relationship information (R) // $k - Series data for related item (R) // $m - Material-specific details (NR) // $n - Note (R) // $o - Other item identifier (R) // $r - Report number (R) // $c - Qualifying information (NR) // $d - Place, publisher, and date of publication (NR) // $g - Related parts (R) // $h - Physical description (NR) // $i - Relationship information (R) // $k - Series data for related item (R) // $m - Material-specific details (NR) // $n - Note (R) // $o - Other item identifier (R) // $r - Report number (R) case 's': // $s - Uniform title (NR) $this->uniform_title = $subfield->value; break; case 't': // $t - Title (NR) $this->title = $subfield->value; break; // $u - Standard Technical Report Number (NR) // $w - Record control number (R) // $u - Standard Technical Report Number (NR) // $w - Record control number (R) case 'x': // $x - International Standard Serial Number (NR) array_push($this->issns, $subfield->value); break; // $y - CODEN designation (NR) // $y - CODEN designation (NR) case 'z': // $z - International Standard Book Number (R) array_push($this->isbns, $subfield->value); break; // $4 - Relationship code (R) // $6 - Linkage (NR) // $7 - Control subfield (NR) // /0 - Type of main entry heading // /1 - Form of name // /2 - Type of record // /3 - Bibliographic level // $8 - Field link and sequence number (R) // $4 - Relationship code (R) // $6 - Linkage (NR) // $7 - Control subfield (NR) // /0 - Type of main entry heading // /1 - Form of name // /2 - Type of record // /3 - Bibliographic level // $8 - Field link and sequence number (R) default: // everything else is a note array_push($this->notes, $subfield->value); break; } } }
protected function parseTitle() { // Gale title clean-up, because for some reason unknown to man they put weird // notes and junk at the end of the title. so remove them here and add them to notes. if (strstr($this->source, 'GALE_')) { $arrMatches = array(); $strGaleRegExp = '/\\(([^)]*)\\)/'; $title = $this->marc->datafield("245"); $title_main = $title->subfield("a"); $title_sub = $title->subfield("b"); $note_field = new Marc\DataField(); $note_field->tag = "500"; if ($title_main != null) { if (preg_match_all($strGaleRegExp, $title_main->value, $arrMatches) != 0) { $title_main->value = preg_replace($strGaleRegExp, "", $title_main->value); } foreach ($arrMatches[1] as $strMatch) { $subfield = new Marc\Subfield(); $subfield->code = "a"; $subfield->value = "From title: " . $strMatch; $note_field->addSubField($subfield); } } // sub title is only these wacky notes if ($title_sub != null) { $subfield = new Marc\Subfield(); $subfield->code = "a"; $subfield->value = "From title: " . $title_sub->value; $note_field->addSubField($subfield); $title_sub->value = ""; } if ($note_field->subfield("a")->length() > 0) { $this->marc->addDataField($note_field); } } parent::parseTitle(); // last chance, check the context object if ($this->title == "" && $this->context_object->getTitle() != null) { $this->title = $this->context_object->getTitle(); } }