@@ -101,9 +101,14 @@ class Item implements HttpTransportable, UUIDReference
101101 private $ score ;
102102
103103 /**
104- * @var RepositoryReference
104+ * @var AppUUID|null
105105 */
106- private $ repositoryReference ;
106+ private $ appUUID ;
107+
108+ /**
109+ * @var IndexUUID|null
110+ */
111+ private $ indexUUID ;
107112
108113 /**
109114 * Item constructor.
@@ -496,19 +501,28 @@ public function setScore(float $score)
496501 }
497502
498503 /**
499- * @return RepositoryReference|null
504+ * @param RepositoryReference $repositoryReference
500505 */
501- public function getRepositoryReference ():? RepositoryReference
506+ public function setRepositoryReference ( RepositoryReference $ repositoryReference )
502507 {
503- return $ this ->repositoryReference ;
508+ $ this ->appUUID = $ repositoryReference ->getAppUUID ();
509+ $ this ->indexUUID = $ repositoryReference ->getIndexUUID ();
504510 }
505511
506512 /**
507- * @param RepositoryReference $repositoryReference
513+ * @return AppUUID|null
508514 */
509- public function setRepositoryReference ( RepositoryReference $ repositoryReference )
515+ public function getAppUUID (): ? AppUUID
510516 {
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 ;
512526 }
513527
514528 /**
@@ -532,8 +546,11 @@ public function toArray(): array
532546 'highlights ' => $ this ->highlights ,
533547 'is_promoted ' => !$ this ->promoted ? null : true ,
534548 '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 ()
537554 : null ,
538555 ], function ($ element ) {
539556 return
@@ -602,8 +619,12 @@ public static function createFromArray(array $array): self
602619 $ item ->setScore ((float ) $ array ['score ' ]);
603620 }
604621
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 ' ]);
607628 }
608629
609630 return $ item ;
0 commit comments