3
3
namespace App \Http \Controllers ;
4
4
5
5
use App \SolrImporter ;
6
- use Config ;
6
+ use App \DirectUs ;
7
+ use Illuminate \Support \Facades \Config ;
7
8
use Illuminate \Support \Str ;
8
9
use PHPShopify \Exception \ApiException ;
9
10
use PHPShopify \Exception \CurlException ;
13
14
use Solarium \QueryType \Update \Result ;
14
15
use Symfony \Component \EventDispatcher \EventDispatcher ;
15
16
16
- class solrimportController extends Controller
17
+ class solrImportController extends Controller
17
18
{
18
19
/**
19
20
* @return ResultInterface|Result
20
21
*/
21
22
public function staff (): Result |ResultInterface
22
23
{
23
- $ api = $ this ->getApi ();
24
- $ api ->setEndpoint ('staff_profiles ' );
25
- $ api ->setArguments (
24
+ $ api = new DirectUs (
25
+ 'staff_profiles ' ,
26
26
array (
27
27
'limit ' => '500 ' ,
28
28
'fields ' => 'id,display_name,biography,slug,profile_image.* '
@@ -45,9 +45,8 @@ public function staff(): Result|ResultInterface
45
45
*/
46
46
public function affiliates (): Result |ResultInterface
47
47
{
48
- $ api = $ this ->getApi ();
49
- $ api ->setEndpoint ('affiliate_researchers ' );
50
- $ api ->setArguments (
48
+ $ api = new DirectUs (
49
+ 'affiliate_researchers ' ,
51
50
array (
52
51
'limit ' => '500 ' ,
53
52
'fields ' => 'id,display_name,biography,slug,profile_image.* '
@@ -70,9 +69,8 @@ public function affiliates(): Result|ResultInterface
70
69
*/
71
70
public function news (): Result |ResultInterface
72
71
{
73
- $ api = $ this ->getApi ();
74
- $ api ->setEndpoint ('news_articles ' );
75
- $ api ->setArguments (
72
+ $ api = new DirectUs (
73
+ 'news_articles ' ,
76
74
array (
77
75
'limit ' => '500 ' ,
78
76
'fields ' => 'id,article_title,article_body,slug,publication_date,field_image.* '
@@ -95,9 +93,8 @@ public function news(): Result|ResultInterface
95
93
*/
96
94
public function stubs (): Result |ResultInterface
97
95
{
98
- $ api = $ this ->getApi ();
99
- $ api ->setEndpoint ('stubs_and_pages ' );
100
- $ api ->setArguments (
96
+ $ api = new DirectUs (
97
+ 'stubs_and_pages ' ,
101
98
array (
102
99
'limit ' => '500 ' ,
103
100
'fields ' => 'id,section,title,body,slug,hero_image.* '
@@ -118,11 +115,10 @@ public function stubs(): Result|ResultInterface
118
115
/**
119
116
* @return ResultInterface|Result
120
117
*/
121
- public function researchprojects (): Result |ResultInterface
118
+ public function researchProjects (): Result |ResultInterface
122
119
{
123
- $ api = $ this ->getApi ();
124
- $ api ->setEndpoint ('research_projects ' );
125
- $ api ->setArguments (
120
+ $ api = new DirectUs (
121
+ 'research_projects ' ,
126
122
array (
127
123
'limit ' => '500 ' ,
128
124
'fields ' => 'id,title,project_overview,slug,hero_image.* '
@@ -145,9 +141,8 @@ public function researchprojects(): Result|ResultInterface
145
141
*/
146
142
public function galleries (): Result |ResultInterface
147
143
{
148
- $ api = $ this ->getApi ();
149
- $ api ->setEndpoint ('galleries ' );
150
- $ api ->setArguments (
144
+ $ api = new DirectUs (
145
+ 'galleries ' ,
151
146
array (
152
147
'limit ' => '500 ' ,
153
148
'fields ' => 'id,gallery_name,gallery_description,slug,hero_image.* '
@@ -170,9 +165,8 @@ public function galleries(): Result|ResultInterface
170
165
*/
171
166
public function collections (): Result |ResultInterface
172
167
{
173
- $ api = $ this ->getApi ();
174
- $ api ->setEndpoint ('collections ' );
175
- $ api ->setArguments (
168
+ $ api = new DirectUs (
169
+ 'collections ' ,
176
170
array (
177
171
'limit ' => '500 ' ,
178
172
'fields ' => 'id,collection_name,collection_description,slug,hero_image.* '
@@ -193,11 +187,10 @@ public function collections(): Result|ResultInterface
193
187
/**
194
188
* @return ResultInterface|Result
195
189
*/
196
- public function lookthinkdo (): Result |ResultInterface
190
+ public function lookThinkDo (): Result |ResultInterface
197
191
{
198
- $ api = $ this ->getApi ();
199
- $ api ->setEndpoint ('look_think_do ' );
200
- $ api ->setArguments (
192
+ $ api = new DirectUs (
193
+ 'look_think_do ' ,
201
194
array (
202
195
'limit ' => '500 ' ,
203
196
'fields ' => 'id,title_of_work,main_text_description,slug,focus_image.* '
@@ -220,9 +213,8 @@ public function lookthinkdo(): Result|ResultInterface
220
213
*/
221
214
public function highlights (): Result |ResultInterface
222
215
{
223
- $ api = $ this ->getApi ();
224
- $ api ->setEndpoint ('pharos ' );
225
- $ api ->setArguments (
216
+ $ api = new DirectUs (
217
+ 'pharos ' ,
226
218
array (
227
219
'limit ' => '500 ' ,
228
220
'fields ' => 'id,title,description,slug,image.* '
@@ -245,9 +237,8 @@ public function highlights(): Result|ResultInterface
245
237
*/
246
238
public function pressroom (): Result |ResultInterface
247
239
{
248
- $ api = $ this ->getApi ();
249
- $ api ->setEndpoint ('pressroom_files ' );
250
- $ api ->setArguments (
240
+ $ api = new DirectUs (
241
+ 'pressroom_files ' ,
251
242
array (
252
243
'limit ' => '500 ' ,
253
244
'fields ' => 'id,title,body,file.type,file.filesize,file.data,hero_image.* '
@@ -275,9 +266,8 @@ public function pressroom(): Result|ResultInterface
275
266
*/
276
267
public function departments (): Result |ResultInterface
277
268
{
278
- $ api = $ this ->getApi ();
279
- $ api ->setEndpoint ('departments ' );
280
- $ api ->setArguments (
269
+ $ api = new DirectUs (
270
+ 'departments ' ,
281
271
array (
282
272
'limit ' => '20 ' ,
283
273
'fields ' => 'id,title,department_description,slug,hero_image.* '
@@ -300,9 +290,8 @@ public function departments(): Result|ResultInterface
300
290
*/
301
291
public function vacancies (): Result |ResultInterface
302
292
{
303
- $ api = $ this ->getApi ();
304
- $ api ->setEndpoint ('vacancies ' );
305
- $ api ->setArguments (
293
+ $ api = new DirectUs (
294
+ 'vacancies ' ,
306
295
array (
307
296
'fields ' => 'id,job_title,job_description,slug,hero_image.* '
308
297
)
@@ -324,9 +313,8 @@ public function vacancies(): Result|ResultInterface
324
313
*/
325
314
public function directors (): Result |ResultInterface
326
315
{
327
- $ api = $ this ->getApi ();
328
- $ api ->setEndpoint ('directors ' );
329
- $ api ->setArguments (
316
+ $ api = new DirectUs (
317
+ 'directors ' ,
330
318
array (
331
319
'limit ' => '20 ' ,
332
320
'fields ' => 'id,display_name,biography,slug,hero_image.* '
@@ -347,11 +335,10 @@ public function directors(): Result|ResultInterface
347
335
/**
348
336
* @return ResultInterface|Result
349
337
*/
350
- public function pharospages (): Result |ResultInterface
338
+ public function pharosPages (): Result |ResultInterface
351
339
{
352
- $ api = $ this ->getApi ();
353
- $ api ->setEndpoint ('pharos_pages ' );
354
- $ api ->setArguments (
340
+ $ api = new DirectUs (
341
+ 'pharos_pages ' ,
355
342
array (
356
343
'limit ' => '500 ' ,
357
344
'fields ' => 'id,title,body,slug,section,hero_image.* '
@@ -374,9 +361,8 @@ public function pharospages(): Result|ResultInterface
374
361
*/
375
362
public function floor (): Result |ResultInterface
376
363
{
377
- $ api = $ this ->getApi ();
378
- $ api ->setEndpoint ('floorplans_guides ' );
379
- $ api ->setArguments (
364
+ $ api = new DirectUs (
365
+ 'floorplans_guides ' ,
380
366
array (
381
367
'limit ' => '10 ' ,
382
368
'fields ' => 'id,title,description,file.type,file.filesize,file.data, '
@@ -403,9 +389,8 @@ public function floor(): Result|ResultInterface
403
389
*/
404
390
public function governance (): Result |ResultInterface
405
391
{
406
- $ api = $ this ->getApi ();
407
- $ api ->setEndpoint ('governance_files ' );
408
- $ api ->setArguments (
392
+ $ api = new DirectUs (
393
+ 'governance_files ' ,
409
394
array (
410
395
'limit ' => '500 ' ,
411
396
'fields ' => 'id,title,file.type,file.filesize,file.data, '
@@ -430,11 +415,10 @@ public function governance(): Result|ResultInterface
430
415
/**
431
416
* @return ResultInterface|Result
432
417
*/
433
- public function learningfiles (): Result |ResultInterface
418
+ public function learningFiles (): Result |ResultInterface
434
419
{
435
- $ api = $ this ->getApi ();
436
- $ api ->setEndpoint ('learning_files ' );
437
- $ api ->setArguments (
420
+ $ api = new DirectUs (
421
+ 'learning_files ' ,
438
422
array (
439
423
'limit ' => '500 ' ,
440
424
'fields ' => 'id,title,type,curriculum_area,key_stage,keystages,file.type,file.filesize,file.data, '
@@ -461,9 +445,8 @@ public function learningfiles(): Result|ResultInterface
461
445
*/
462
446
public function exhibitions (): Result |ResultInterface
463
447
{
464
- $ api = $ this ->getApi ();
465
- $ api ->setEndpoint ('exhibitions ' );
466
- $ api ->setArguments (
448
+ $ api = new DirectUs (
449
+ 'exhibitions ' ,
467
450
array (
468
451
'limit ' => '500 ' ,
469
452
'fields ' => 'id,exhibition_title,exhibition_narrative,slug,hero_image.* '
@@ -486,9 +469,8 @@ public function exhibitions(): Result|ResultInterface
486
469
*/
487
470
public function audio (): Result |ResultInterface
488
471
{
489
- $ api = $ this ->getApi ();
490
- $ api ->setEndpoint ('audio_guide ' );
491
- $ api ->setArguments (
472
+ $ api = new DirectUs (
473
+ 'audio_guide ' ,
492
474
array (
493
475
'limit ' => '500 ' ,
494
476
'fields ' => 'id,title,stop_number,transcription,slug,hero_image.* '
@@ -511,9 +493,8 @@ public function audio(): Result|ResultInterface
511
493
*/
512
494
public function sessions (): Result |ResultInterface
513
495
{
514
- $ api = $ this ->getApi ();
515
- $ api ->setEndpoint ('school_sessions ' );
516
- $ api ->setArguments (
496
+ $ api = new DirectUs (
497
+ 'school_sessions ' ,
517
498
array (
518
499
'limit ' => '30 ' ,
519
500
'fields ' => 'id,title,description,format_session,quote,key_stages,theme,session_type,slug,type_of_activity,curriculum_link,hero_image.* '
@@ -574,9 +555,8 @@ public function shopify(): Result|ResultInterface
574
555
*/
575
556
public function podcasts (): Result |ResultInterface
576
557
{
577
- $ api = $ this ->getApi ();
578
- $ api ->setEndpoint ('podcast_archive ' );
579
- $ api ->setArguments (
558
+ $ api = new DirectUs (
559
+ 'podcast_archive ' ,
580
560
array (
581
561
'limit ' => '500 ' ,
582
562
'fields ' => 'id,title,description,slug,hero_image.* '
@@ -597,11 +577,10 @@ public function podcasts(): Result|ResultInterface
597
577
/**
598
578
* @return ResultInterface|Result
599
579
*/
600
- public function podcastseries (): Result |ResultInterface
580
+ public function podcastSeries (): Result |ResultInterface
601
581
{
602
- $ api = $ this ->getApi ();
603
- $ api ->setEndpoint ('podcast_series ' );
604
- $ api ->setArguments (
582
+ $ api = new DirectUs (
583
+ 'podcast_series ' ,
605
584
array (
606
585
'limit ' => '50 ' ,
607
586
'fields ' => 'id,title,slug,cover_image.* '
@@ -624,9 +603,8 @@ public function podcastseries(): Result|ResultInterface
624
603
*/
625
604
public function mindseye (): Result |ResultInterface
626
605
{
627
- $ api = $ this ->getApi ();
628
- $ api ->setEndpoint ('mindseye ' );
629
- $ api ->setArguments (
606
+ $ api = new DirectUs (
607
+ 'mindseye ' ,
630
608
array (
631
609
'limit ' => '10 ' ,
632
610
'fields ' => 'id,title,story,slug,hero_image.* ' ,
@@ -650,9 +628,8 @@ public function mindseye(): Result|ResultInterface
650
628
*/
651
629
public function resources (): Result |ResultInterface
652
630
{
653
- $ api = $ this ->getApi ();
654
- $ api ->setEndpoint ('online_resources ' );
655
- $ api ->setArguments (
631
+ $ api = new DirectUs (
632
+ 'online_resources ' ,
656
633
array (
657
634
'limit ' => '200 ' ,
658
635
'fields ' => 'id,title,description,slug,hero_image.* ' ,
@@ -675,9 +652,8 @@ public function resources(): Result|ResultInterface
675
652
*/
676
653
public function ttnArtists (): Result |ResultInterface
677
654
{
678
- $ api = $ this ->getApi ();
679
- $ api ->setEndpoint ('ttn_artists ' );
680
- $ api ->setArguments (
655
+ $ api = new DirectUs (
656
+ 'ttn_artists ' ,
681
657
array (
682
658
'limit ' => '200 ' ,
683
659
'fields ' => 'id,display_name,biography,slug,image.* ' ,
@@ -700,9 +676,8 @@ public function ttnArtists(): Result|ResultInterface
700
676
*/
701
677
public function ttnLabels (): Result |ResultInterface
702
678
{
703
- $ api = $ this ->getApi ();
704
- $ api ->setEndpoint ('ttn_labels ' );
705
- $ api ->setArguments (
679
+ $ api = new DirectUs (
680
+ 'ttn_labels ' ,
706
681
array (
707
682
'limit ' => '200 ' ,
708
683
'fields ' => 'id,title,slug,image.* ' ,
@@ -725,9 +700,8 @@ public function ttnLabels(): Result|ResultInterface
725
700
*/
726
701
public function longform (): Result |ResultInterface
727
702
{
728
- $ api = $ this ->getApi ();
729
- $ api ->setEndpoint ('long_form ' );
730
- $ api ->setArguments (
703
+ $ api = new DirectUs (
704
+ 'long_form ' ,
731
705
array (
732
706
'limit ' => '200 ' ,
733
707
'fields ' => 'id,title,description,hero_image.* ' ,
@@ -750,9 +724,8 @@ public function longform(): Result|ResultInterface
750
724
*/
751
725
public function spoliation (): Result |ResultInterface
752
726
{
753
- $ api = $ this ->getApi ();
754
- $ api ->setEndpoint ('spoliation_claims ' );
755
- $ api ->setArguments (
727
+ $ api = new DirectUs (
728
+ 'spoliation_claims ' ,
756
729
array (
757
730
'limit ' => '200 ' ,
758
731
'fields ' => 'id,alt_text,text,priref,image.* ' ,
@@ -775,9 +748,8 @@ public function spoliation(): Result|ResultInterface
775
748
*/
776
749
public function viewpoints (): Result |ResultInterface
777
750
{
778
- $ api = $ this ->getApi ();
779
- $ api ->setEndpoint ('ttn_viewpoints ' );
780
- $ api ->setArguments (
751
+ $ api = new DirectUs (
752
+ 'ttn_viewpoints ' ,
781
753
array (
782
754
'fields ' => '*.*.*.* '
783
755
)
0 commit comments