From 840a5535af6297a47c6117b0f9409e23318e0125 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Samuli=20Sillanp=C3=A4=C3=A4?= <samuli.sillanpaa@helsinki.fi> Date: Wed, 26 Feb 2020 16:13:16 +0200 Subject: [PATCH] Refactor to get record loader via class method. (#1557) --- module/VuFind/src/VuFind/Controller/HierarchyController.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/module/VuFind/src/VuFind/Controller/HierarchyController.php b/module/VuFind/src/VuFind/Controller/HierarchyController.php index be65a4bbe65..5aa8822f01f 100644 --- a/module/VuFind/src/VuFind/Controller/HierarchyController.php +++ b/module/VuFind/src/VuFind/Controller/HierarchyController.php @@ -124,7 +124,7 @@ class HierarchyController extends AbstractBase $id = $this->params()->fromQuery('id'); $source = $this->params() ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); - $loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); + $loader = $this->getRecordLoader(); try { if ($recordDriver = $loader->load($id, $source)) { $results = $recordDriver->getHierarchyDriver()->render( @@ -159,7 +159,7 @@ class HierarchyController extends AbstractBase $id = $this->params()->fromQuery('id'); $source = $this->params() ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); - $loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); + $loader = $this->getRecordLoader(); try { if ($recordDriver = $loader->load($id, $source)) { $results = $recordDriver->getHierarchyDriver() @@ -191,7 +191,7 @@ class HierarchyController extends AbstractBase $id = $this->params()->fromQuery('id'); $source = $this->params() ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); - $loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); + $loader = $this->getRecordLoader(); try { $record = $loader->load($id, $source); $result = $this->getViewRenderer()->record($record) -- GitLab