The Gitlab instance will be restarted on Monday April 28th at 2AM. There will be a short interruption of service.

Skip to content
Snippets Groups Projects
Commit 840a5535 authored by Samuli Sillanpää's avatar Samuli Sillanpää Committed by Robert Lange
Browse files

Refactor to get record loader via class method. (#1557)

parent df8feabb
No related merge requests found
...@@ -124,7 +124,7 @@ class HierarchyController extends AbstractBase ...@@ -124,7 +124,7 @@ class HierarchyController extends AbstractBase
$id = $this->params()->fromQuery('id'); $id = $this->params()->fromQuery('id');
$source = $this->params() $source = $this->params()
->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND);
$loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); $loader = $this->getRecordLoader();
try { try {
if ($recordDriver = $loader->load($id, $source)) { if ($recordDriver = $loader->load($id, $source)) {
$results = $recordDriver->getHierarchyDriver()->render( $results = $recordDriver->getHierarchyDriver()->render(
...@@ -159,7 +159,7 @@ class HierarchyController extends AbstractBase ...@@ -159,7 +159,7 @@ class HierarchyController extends AbstractBase
$id = $this->params()->fromQuery('id'); $id = $this->params()->fromQuery('id');
$source = $this->params() $source = $this->params()
->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND);
$loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); $loader = $this->getRecordLoader();
try { try {
if ($recordDriver = $loader->load($id, $source)) { if ($recordDriver = $loader->load($id, $source)) {
$results = $recordDriver->getHierarchyDriver() $results = $recordDriver->getHierarchyDriver()
...@@ -191,7 +191,7 @@ class HierarchyController extends AbstractBase ...@@ -191,7 +191,7 @@ class HierarchyController extends AbstractBase
$id = $this->params()->fromQuery('id'); $id = $this->params()->fromQuery('id');
$source = $this->params() $source = $this->params()
->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND); ->fromQuery('hierarchySource', DEFAULT_SEARCH_BACKEND);
$loader = $this->serviceLocator->get(\VuFind\Record\Loader::class); $loader = $this->getRecordLoader();
try { try {
$record = $loader->load($id, $source); $record = $loader->load($id, $source);
$result = $this->getViewRenderer()->record($record) $result = $this->getViewRenderer()->record($record)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment