1--TEST--
2marc_004: Delete fields and subfields
3--SKIPIF--
4<?php include('tests/skipif.inc'); ?>
5--FILE--
6<?php
7$dir = dirname(__FILE__);
8require __DIR__ . '/bootstrap.php';
9$marc_file = new File_MARC($dir . '/' . 'music.mrc');
10
11print "\nDelete all fields with tag 650\n";
12while ($marc_record = $marc_file->next()) {
13  print "\nNext record:\n";
14  $fields = $marc_record->getFields('650');
15  foreach ($fields as $field) {
16    $field->delete();
17  }
18  print $marc_record;
19}
20
21$marc_file = null;
22$marc_file = new File_MARC($dir . '/' . 'music.mrc');
23
24print "\nDelete all subfields with code 'a' from fields with tag 650\n";
25while ($marc_record = $marc_file->next()) {
26  print "\nNext record:\n";
27  $fields = $marc_record->getFields('650');
28  foreach ($fields as $field) {
29    $sf = $field->getSubfields('a');
30    foreach ($sf as $subfield) {
31      $field->deleteSubfield($subfield);
32    }
33  }
34  print $marc_record;
35}
36
37?>
38--EXPECT--
39Delete all fields with tag 650
40
41Next record:
42LDR 01145ncm  2200277 i 4500
43001     000073594
44004     AAJ5802
45005     20030415102100.0
46008     801107s1977    nyujza
47010    _a   77771106
48035    _a(CaOTUIC)15460184
49035 9  _aAAJ5802
50040    _aLC
51050 00 _aM1366
52       _b.M62
53       _dM1527.2
54245 04 _aThe Modern Jazz Quartet :
55       _bThe legendary profile. --
56260    _aNew York :
57       _bM.J.Q. Music,
58       _cc1977.
59300    _ascore (72 p.) ;
60       _c31 cm.
61500    _aFor piano, vibraphone, drums, and double bass.
62505 0  _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.
63700 12 _aLewis, John,
64       _d1920-
65       _tSelections.
66       _f1977.
67700 12 _aJackson, Milt.
68       _tMartyrs.
69       _f1977.
70700 12 _aJackson, Milt.
71       _tLegendary profile.
72       _f1977.
73740 4  _aThe legendary profile.
74852 00 _bMUSIC
75       _cMAIN
76       _kfolio
77       _hM1366
78       _iM62
79       _91
80       _4Marvin Duchow Music
81       _5
82
83Next record:
84LDR 01293cjm  2200289 a 4500
85001     001878039
86005     20050110174900.0
87007     sd fungnn|||e|
88008     940202r19931981nyujzn   i              d
89024 1  _a7464573372
90028 02 _aJK 57337
91       _bRed Baron
92035    _a(OCoLC)29737267
93040    _aSVP
94       _cSVP
95       _dLGG
96100 1  _aDesmond, Paul,
97       _d1924-
98245 10 _aPaul Desmond & the Modern Jazz Quartet
99       _h[sound recording]
100260    _aNew York, N.Y. :
101       _bRed Baron :
102       _bManufactured by Sony Music Entertainment,
103       _cp1993.
104300    _a1 sound disc (39 min.) :
105       _bdigital ;
106       _c4 3/4 in.
107511 0  _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums.
108500    _aAll arrangements by John Lewis.
109518    _aRecorded live on December 25, 1971 at Town Hall, NYC.
110500    _aOriginally released in 1981 by Finesse as LP FW 27487.
111500    _aProgram notes by Irving Townsend, June 1981, on container insert.
112505 0  _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove.
113700 1  _aLewis, John,
114       _d1920-
115710 2  _aModern Jazz Quartet.
116740 0  _aPaul Desmond and the Modern Jazz Quartet.
117
118Next record:
119LDR 01829cjm  2200385 a 4500
120001     001964482
121005     20060626132700.0
122007     sd fzngnn|m|e|
123008     871211p19871957nyujzn                  d
124024 1  _a4228332902
125028 01 _a833 290-2
126       _bVerve
127033 0  _a19571027
128       _b6299
129       _cD56
130033 0  _a196112--
131       _b3804
132       _cN4
133033 0  _a19571019
134       _b4104
135       _cC6
136033 0  _a197107--
137       _b6299
138       _cV7
139035    _a(OCoLC)17222092
140040    _aCPL
141       _cCPL
142       _dOCL
143       _dLGG
144048    _apz01
145       _aka01
146       _asd01
147       _apd01
148110 2  _aModern Jazz Quartet.
149       _4prf
150245 14 _aThe Modern Jazz Quartet plus
151       _h[sound recording].
152260    _a[New York] :
153       _bVerve,
154       _cp1987.
155300    _a1 sound disc :
156       _bdigital ;
157       _c4 3/4 in.
158440  0 _aCompact jazz
159511 0  _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums.
160518    _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work).
161500    _aCompact disc.
162500    _aAnalog recording.
163505 0  _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20).
164700 1  _aJackson, Milt.
165       _4prf
166700 1  _aPeterson, Oscar,
167       _d1925-
168       _4prf
169700 1  _aBrown, Ray,
170       _d1926-2002.
171       _4prf
172700 1  _aThigpen, Ed.
173       _4prf
174700 1  _aHayes, Louis,
175       _d1937-
176       _4prf
177852 80 _bMUSIC
178       _cAV
179       _hCD 1131
180       _4Marvin Duchow Music
181       _5Audio-Visual
182
183Delete all subfields with code 'a' from fields with tag 650
184
185Next record:
186LDR 01145ncm  2200277 i 4500
187001     000073594
188004     AAJ5802
189005     20030415102100.0
190008     801107s1977    nyujza
191010    _a   77771106
192035    _a(CaOTUIC)15460184
193035 9  _aAAJ5802
194040    _aLC
195050 00 _aM1366
196       _b.M62
197       _dM1527.2
198245 04 _aThe Modern Jazz Quartet :
199       _bThe legendary profile. --
200260    _aNew York :
201       _bM.J.Q. Music,
202       _cc1977.
203300    _ascore (72 p.) ;
204       _c31 cm.
205500    _aFor piano, vibraphone, drums, and double bass.
206505 0  _aLewis, J. Django.--Lewis, J. Plastic dreams (music from the film Kemek).--Lewis, J. Dancing (music from the film Kemek).--Lewis, J. Blues in A minor.--Lewis, J. Blues in B♭.--Lewis, J. Precious joy.--Jackson, M. The martyr.--Jackson, M. The legendary profile.
207650  0 _vExcerpts
208       _vScores.
209700 12 _aLewis, John,
210       _d1920-
211       _tSelections.
212       _f1977.
213700 12 _aJackson, Milt.
214       _tMartyrs.
215       _f1977.
216700 12 _aJackson, Milt.
217       _tLegendary profile.
218       _f1977.
219740 4  _aThe legendary profile.
220852 00 _bMUSIC
221       _cMAIN
222       _kfolio
223       _hM1366
224       _iM62
225       _91
226       _4Marvin Duchow Music
227       _5
228
229Next record:
230LDR 01293cjm  2200289 a 4500
231001     001878039
232005     20050110174900.0
233007     sd fungnn|||e|
234008     940202r19931981nyujzn   i              d
235024 1  _a7464573372
236028 02 _aJK 57337
237       _bRed Baron
238035    _a(OCoLC)29737267
239040    _aSVP
240       _cSVP
241       _dLGG
242100 1  _aDesmond, Paul,
243       _d1924-
244245 10 _aPaul Desmond & the Modern Jazz Quartet
245       _h[sound recording]
246260    _aNew York, N.Y. :
247       _bRed Baron :
248       _bManufactured by Sony Music Entertainment,
249       _cp1993.
250300    _a1 sound disc (39 min.) :
251       _bdigital ;
252       _c4 3/4 in.
253511 0  _aPaul Desmond, alto saxophone; Modern Jazz Quartet: John Lewis, piano; Milt Jackson, vibraphone; Percy Heath, bass; Connie Kay, drums.
254500    _aAll arrangements by John Lewis.
255518    _aRecorded live on December 25, 1971 at Town Hall, NYC.
256500    _aOriginally released in 1981 by Finesse as LP FW 27487.
257500    _aProgram notes by Irving Townsend, June 1981, on container insert.
258505 0  _aGreensleeves -- You go to my head -- Blue dove -- Jesus Christ Superstar -- Here's that rainy day -- East of the sun -- Bags' new groove.
259650  0 _y1971-1980.
260700 1  _aLewis, John,
261       _d1920-
262710 2  _aModern Jazz Quartet.
263740 0  _aPaul Desmond and the Modern Jazz Quartet.
264
265Next record:
266LDR 01829cjm  2200385 a 4500
267001     001964482
268005     20060626132700.0
269007     sd fzngnn|m|e|
270008     871211p19871957nyujzn                  d
271024 1  _a4228332902
272028 01 _a833 290-2
273       _bVerve
274033 0  _a19571027
275       _b6299
276       _cD56
277033 0  _a196112--
278       _b3804
279       _cN4
280033 0  _a19571019
281       _b4104
282       _cC6
283033 0  _a197107--
284       _b6299
285       _cV7
286035    _a(OCoLC)17222092
287040    _aCPL
288       _cCPL
289       _dOCL
290       _dLGG
291048    _apz01
292       _aka01
293       _asd01
294       _apd01
295110 2  _aModern Jazz Quartet.
296       _4prf
297245 14 _aThe Modern Jazz Quartet plus
298       _h[sound recording].
299260    _a[New York] :
300       _bVerve,
301       _cp1987.
302300    _a1 sound disc :
303       _bdigital ;
304       _c4 3/4 in.
305440  0 _aCompact jazz
306511 0  _aModern Jazz Quartet (principally) ; Milt Jackson, vibraphone (2nd and 8th works) ; Oscar Peterson, piano (2nd and 8th works) ; Ray Brown, bass (2nd and 8th works) ; Ed Thigpen (2nd work), Louis Hayes (8th work), drums.
307518    _aRecorded live, Oct. 27, 1957, at the Donaueschingen Jazz Festival (1st, 5th, 7th, and 10th works); Dec. 1961, in New York (2nd work); live, Oct. 19, 1957, at the Opera House, Chicago (3rd, 4th, 6th, and 9th works); July 1971, in Villingen, Germany (8th work).
308500    _aCompact disc.
309500    _aAnalog recording.
310505 0  _aThe golden striker (4:08) -- On Green Dolphin Street (7:28) -- D & E (4:55) -- I'll remember April (4:51) -- Cortège (7:15) -- Now's the time (4:43) -- J.B. blues (5:09) -- Reunion blues (6:35) -- 'Round midnight (3:56) -- Three windows (7:20).
311700 1  _aJackson, Milt.
312       _4prf
313700 1  _aPeterson, Oscar,
314       _d1925-
315       _4prf
316700 1  _aBrown, Ray,
317       _d1926-2002.
318       _4prf
319700 1  _aThigpen, Ed.
320       _4prf
321700 1  _aHayes, Louis,
322       _d1937-
323       _4prf
324852 80 _bMUSIC
325       _cAV
326       _hCD 1131
327       _4Marvin Duchow Music
328       _5Audio-Visual
329