Skip to content

Commit

Permalink
Refactor to get record loader via class method. (#1557)
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuli Sillanpää committed Feb 26, 2020
1 parent ea4d486 commit 937dcb8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions module/VuFind/src/VuFind/Controller/HierarchyController.php
Expand Up @@ -124,7 +124,7 @@ public function gettreeAction()
$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(
Expand Down Expand Up @@ -159,7 +159,7 @@ public function gettreejsonAction()
$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()
Expand Down Expand Up @@ -191,7 +191,7 @@ public function getrecordAction()
$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)
Expand Down

0 comments on commit 937dcb8

Please sign in to comment.