/application/src/Xerxes/Record/Bibliographic/LinkedItem.php

https://github.com/dswalker/xerxes · PHP · 95 lines · 38 code · 22 blank · 35 comment · 1 complexity · 64d29799519ee17a335ee6f7ae6545bb MD5 · raw file

  1. <?php
  2. /*
  3. * This file is part of Xerxes.
  4. *
  5. * (c) California State University <library@calstate.edu>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Xerxes\Record\Bibliographic;
  11. use Xerxes\Marc\DataField;
  12. class LinkedItem
  13. {
  14. public $title;
  15. public $edition;
  16. public $issns = array();
  17. public $isbns = array();
  18. public $notes = array();
  19. /**
  20. * Creates a new LinkedItem for 78x fields
  21. *
  22. * @param DataField $datafield
  23. */
  24. public function __construct(DataField $datafield)
  25. {
  26. foreach ( $datafield->subfield() as $subfield )
  27. {
  28. switch ( $subfield->code )
  29. {
  30. // $a - Main entry heading (NR)
  31. case 'b': // $b - Edition (NR)
  32. $this->edition = $subfield->value;
  33. break;
  34. // $c - Qualifying information (NR)
  35. // $d - Place, publisher, and date of publication (NR)
  36. // $g - Related parts (R)
  37. // $h - Physical description (NR)
  38. // $i - Relationship information (R)
  39. // $k - Series data for related item (R)
  40. // $m - Material-specific details (NR)
  41. // $n - Note (R)
  42. // $o - Other item identifier (R)
  43. // $r - Report number (R)
  44. case 's': // $s - Uniform title (NR)
  45. $this->uniform_title = $subfield->value;
  46. break;
  47. case 't': // $t - Title (NR)
  48. $this->title = $subfield->value;
  49. break;
  50. // $u - Standard Technical Report Number (NR)
  51. // $w - Record control number (R)
  52. case 'x': // $x - International Standard Serial Number (NR)
  53. array_push($this->issns, $subfield->value);
  54. break;
  55. // $y - CODEN designation (NR)
  56. case 'z': // $z - International Standard Book Number (R)
  57. array_push($this->isbns, $subfield->value);
  58. break;
  59. // $4 - Relationship code (R)
  60. // $6 - Linkage (NR)
  61. // $7 - Control subfield (NR)
  62. // /0 - Type of main entry heading
  63. // /1 - Form of name
  64. // /2 - Type of record
  65. // /3 - Bibliographic level
  66. // $8 - Field link and sequence number (R)
  67. default: // everything else is a note
  68. array_push($this->notes, $subfield->value);
  69. break;
  70. }
  71. }
  72. }
  73. }