From d7c96900f8495ca88e885f96c041a8a3ef09e6da Mon Sep 17 00:00:00 2001 From: siiriylonen <117457514+siiriylonen@users.noreply.github.com> Date: Thu, 19 Oct 2023 13:32:27 +0300 Subject: [PATCH] [FINNA-1114] LIDO: Add repository locations to geographic places (#146) --- src/RecordManager/Base/Record/Lido.php | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/RecordManager/Base/Record/Lido.php b/src/RecordManager/Base/Record/Lido.php index f2a61adef..25006c4f2 100644 --- a/src/RecordManager/Base/Record/Lido.php +++ b/src/RecordManager/Base/Record/Lido.php @@ -1293,6 +1293,27 @@ protected function getIdentifiersByType( return $result; } + /** + * Return repository locations + * + * @return array + */ + protected function getRepositoryLocations(): array + { + $result = []; + foreach ( + $this->doc->lido->descriptiveMetadata->objectIdentificationWrap->repositoryWrap->repositorySet + ?? [] as $set + ) { + foreach ($set->repositoryLocation->namePlaceSet ?? [] as $nameSet) { + foreach ($nameSet->appellationValue ?? [] as $place) { + $result[] = (string)$place; + } + } + } + return $result; + } + /** * Get main event types * @@ -1378,6 +1399,8 @@ protected function getDisplayPlaces(): array if ($places = $this->getSubjectDisplayPlaces()) { $result = [...$result, ...$places]; } + $idPlaces = $this->getRepositoryLocations(); + $result = [...$result, ...$idPlaces]; return $result; }