From 942ddeed92a457f0466142fd205be9d104ca3e28 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:55:37 +0300 Subject: [PATCH 1/6] Adjusted the function so there is no overlap --- src/RecordManager/Finna/Record/Lido.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index 7aa30ebb..db4cf7db 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -285,7 +285,7 @@ public function toSolrArray(Database $db = null) } $data['location_geo'] = [ ...$this->getEventPlaceLocations(), - ...$this->getRepositoryLocations(), + ...$this->getRepositoryLocationCoordinates(), ]; $data['center_coords'] = $this->metadataUtils->getCenterCoordinates($data['location_geo']); @@ -548,7 +548,7 @@ protected function getHierarchicalLocations(\SimpleXMLElement $elem): array * * @return array */ - protected function getRepositoryLocations(): array + protected function getRepositoryLocationCoordinates(): array { $results = []; foreach ( From 6fe3546eed02c4a6197e806b47687213c2cd8ec9 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:56:05 +0300 Subject: [PATCH 2/6] Adjusted the comment to reflect --- src/RecordManager/Finna/Record/Lido.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index db4cf7db..5b83c972 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -544,7 +544,7 @@ protected function getHierarchicalLocations(\SimpleXMLElement $elem): array } /** - * Get repository locations + * Get repository locations as coordinates * * @return array */ From 6cb6f7ab27a1d4896ecfff7681861fa4763fd05f Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:30:36 +0300 Subject: [PATCH 3/6] Event place location coordinates --- src/RecordManager/Finna/Record/Lido.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index 5b83c972..36b13e1e 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -284,7 +284,7 @@ public function toSolrArray(Database $db = null) } } $data['location_geo'] = [ - ...$this->getEventPlaceLocations(), + ...$this->getEventPlaceLocationCoordinates(), ...$this->getRepositoryLocationCoordinates(), ]; $data['center_coords'] @@ -1031,7 +1031,7 @@ protected function completeDate($date, $end = false) * * @return array WKT */ - protected function getEventPlaceLocations($event = null) + protected function getEventPlaceLocationCoordinates($event = null) { $results = []; foreach ($this->getEventNodes($event) as $event) { From e72b407d1062663d1a8a606f0413b84648aaef07 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:31:15 +0300 Subject: [PATCH 4/6] adjust comment --- src/RecordManager/Finna/Record/Lido.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index 36b13e1e..a91f6ab5 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -1025,7 +1025,7 @@ protected function completeDate($date, $end = false) } /** - * Return the event place locations associated with specified event + * Return the event place coordinates associated with specified event * * @param string|array $event Event type(s) allowed (null = all types) * From 2cff2dcf5760719ad73b780530efac48983d8ba9 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:32:20 +0300 Subject: [PATCH 5/6] Adjust comment --- src/RecordManager/Finna/Record/Lido.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index a91f6ab5..1b06367a 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -544,7 +544,7 @@ protected function getHierarchicalLocations(\SimpleXMLElement $elem): array } /** - * Get repository locations as coordinates + * Get repository location coordinates * * @return array */ From fe3a9029bb0cc00fd5327f882d9a2c1432d7c780 Mon Sep 17 00:00:00 2001 From: Juha Luoma <33253757+LuomaJuha@users.noreply.github.com> Date: Wed, 25 Oct 2023 09:34:19 +0300 Subject: [PATCH 6/6] Adjust function name --- src/RecordManager/Finna/Record/Lido.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/RecordManager/Finna/Record/Lido.php b/src/RecordManager/Finna/Record/Lido.php index 1b06367a..64774dcc 100644 --- a/src/RecordManager/Finna/Record/Lido.php +++ b/src/RecordManager/Finna/Record/Lido.php @@ -284,7 +284,7 @@ public function toSolrArray(Database $db = null) } } $data['location_geo'] = [ - ...$this->getEventPlaceLocationCoordinates(), + ...$this->getEventPlaceCoordinates(), ...$this->getRepositoryLocationCoordinates(), ]; $data['center_coords'] @@ -1031,7 +1031,7 @@ protected function completeDate($date, $end = false) * * @return array WKT */ - protected function getEventPlaceLocationCoordinates($event = null) + protected function getEventPlaceCoordinates($event = null) { $results = []; foreach ($this->getEventNodes($event) as $event) {