Skip to content

Commit

Permalink
[FINNA-1114] LIDO: Add repository locations to geographic places (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
siiriylonen authored Oct 19, 2023
1 parent 2a6efe1 commit d7c9690
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions src/RecordManager/Base/Record/Lido.php
Original file line number Diff line number Diff line change
Expand Up @@ -1293,6 +1293,27 @@ protected function getIdentifiersByType(
return $result;
}

/**
* Return repository locations
*
* @return array<int, string>
*/
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
*
Expand Down Expand Up @@ -1378,6 +1399,8 @@ protected function getDisplayPlaces(): array
if ($places = $this->getSubjectDisplayPlaces()) {
$result = [...$result, ...$places];
}
$idPlaces = $this->getRepositoryLocations();
$result = [...$result, ...$idPlaces];
return $result;
}

Expand Down

0 comments on commit d7c9690

Please sign in to comment.