@@ -24,7 +24,12 @@ public static function fromString($data)
24
24
{
25
25
$ collection = Collection::fromString ($ data );
26
26
27
- return $ collection ->records ->toArray ()[0 ];
27
+ $ recs = $ collection ->records ->toArray ();
28
+ if (!count ($ recs )) {
29
+ throw new \ErrorException ('Record not found ' );
30
+ }
31
+
32
+ return $ recs [0 ];
28
33
}
29
34
30
35
/*************************************************************************
@@ -93,11 +98,11 @@ public function getSubjects($vocabulary = null, $type = null)
93
98
'653 ' => 'uncontrolled ' , # Index Term - Uncontrolled
94
99
// 654 : Subject Added Entry - Faceted Topical Terms
95
100
'655 ' => 'form ' , # Index Term - Genre/Form
96
- // 657 - Index Term - Function (R) Full | Concise
97
- // 658 - Index Term - Curriculum Objective (R) Full | Concise
98
- // 662 - Subject Added Entry - Hierarchical Place Name (R) Full | Concise
99
- // 69X - Local Subject Access Fields (R) Full | Concise
100
101
'656 ' => 'occupation ' , # Index Term - Occupation
102
+ // 657 - Index Term - Function
103
+ // 658 - Index Term - Curriculum Objective
104
+ // 662 - Subject Added Entry - Hierarchical Place Name
105
+ // 69X - Local Subject Access Fields
101
106
);
102
107
foreach ($ saf as $ k => $ v ) {
103
108
foreach ($ this ->record ->getFields ($ k ) as $ field ) { // or 655, 648, etc.
@@ -156,4 +161,5 @@ public function __toString()
156
161
{
157
162
return strval ($ this ->record );
158
163
}
164
+
159
165
}
0 commit comments