@@ -101,9 +101,14 @@ class Item implements HttpTransportable, UUIDReference
101
101
private $ score ;
102
102
103
103
/**
104
- * @var RepositoryReference
104
+ * @var AppUUID|null
105
105
*/
106
- private $ repositoryReference ;
106
+ private $ appUUID ;
107
+
108
+ /**
109
+ * @var IndexUUID|null
110
+ */
111
+ private $ indexUUID ;
107
112
108
113
/**
109
114
* Item constructor.
@@ -496,19 +501,28 @@ public function setScore(float $score)
496
501
}
497
502
498
503
/**
499
- * @return RepositoryReference|null
504
+ * @param RepositoryReference $repositoryReference
500
505
*/
501
- public function getRepositoryReference ():? RepositoryReference
506
+ public function setRepositoryReference ( RepositoryReference $ repositoryReference )
502
507
{
503
- return $ this ->repositoryReference ;
508
+ $ this ->appUUID = $ repositoryReference ->getAppUUID ();
509
+ $ this ->indexUUID = $ repositoryReference ->getIndexUUID ();
504
510
}
505
511
506
512
/**
507
- * @param RepositoryReference $repositoryReference
513
+ * @return AppUUID|null
508
514
*/
509
- public function setRepositoryReference ( RepositoryReference $ repositoryReference )
515
+ public function getAppUUID (): ? AppUUID
510
516
{
511
- $ this ->repositoryReference = $ repositoryReference ;
517
+ return $ this ->appUUID ;
518
+ }
519
+
520
+ /**
521
+ * @return IndexUUID|null
522
+ */
523
+ public function getIndexUUID (): ?IndexUUID
524
+ {
525
+ return $ this ->indexUUID ;
512
526
}
513
527
514
528
/**
@@ -532,8 +546,11 @@ public function toArray(): array
532
546
'highlights ' => $ this ->highlights ,
533
547
'is_promoted ' => !$ this ->promoted ? null : true ,
534
548
'score ' => $ this ->score ,
535
- 'repository_reference ' => $ this ->repositoryReference instanceof RepositoryReference
536
- ? $ this ->repositoryReference ->compose ()
549
+ 'app_uuid ' => $ this ->appUUID instanceof AppUUID
550
+ ? $ this ->appUUID ->toArray ()
551
+ : null ,
552
+ 'index_uuid ' => $ this ->indexUUID instanceof IndexUUID
553
+ ? $ this ->indexUUID ->toArray ()
537
554
: null ,
538
555
], function ($ element ) {
539
556
return
@@ -602,8 +619,12 @@ public static function createFromArray(array $array): self
602
619
$ item ->setScore ((float ) $ array ['score ' ]);
603
620
}
604
621
605
- if (isset ($ array ['repository_reference ' ]) && !is_null ($ array ['repository_reference ' ])) {
606
- $ item ->setRepositoryReference (RepositoryReference::createFromComposed ($ array ['repository_reference ' ]));
622
+ if (isset ($ array ['app_uuid ' ]) && !is_null ($ array ['app_uuid ' ])) {
623
+ $ item ->appUUID = AppUUID::createFromArray ($ array ['app_uuid ' ]);
624
+ }
625
+
626
+ if (isset ($ array ['index_uuid ' ]) && !is_null ($ array ['index_uuid ' ])) {
627
+ $ item ->indexUUID = IndexUUID::createFromArray ($ array ['index_uuid ' ]);
607
628
}
608
629
609
630
return $ item ;
0 commit comments