From d3c74b35a974c1800a43193c3e0fd41f9cdea9e0 Mon Sep 17 00:00:00 2001
From: Robert Lange <robert.lange@uni-leipzig.de>
Date: Tue, 16 Jun 2020 18:30:42 +0200
Subject: [PATCH] refs #17783 [fid] use finc RecordDataFormatterFacory

* extend RecordDataFormatterFacory of finc in fid
* RecordDataFormatterFacory in adlr and bbi should be refactored / scaled down
---
 .../View/Helper/Root/RecordDataFormatterFactory.php   | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/module/fid/src/View/Helper/Root/RecordDataFormatterFactory.php b/module/fid/src/View/Helper/Root/RecordDataFormatterFactory.php
index 185a746ac8c..4de990d6e76 100644
--- a/module/fid/src/View/Helper/Root/RecordDataFormatterFactory.php
+++ b/module/fid/src/View/Helper/Root/RecordDataFormatterFactory.php
@@ -26,10 +26,11 @@
  */
 namespace fid\View\Helper\Root;
 
+use finc\View\Helper\Root\RecordDataFormatterFactory as FincRecordDataFormatterFactory;
 use VuFind\View\Helper\Root\RecordDataFormatter;
 use VuFind\View\Helper\Root\RecordDataFormatter\SpecBuilder;
 
-class RecordDataFormatterFactory
+class RecordDataFormatterFactory extends FincRecordDataFormatterFactory
 {
     /**
      * Create the helper.
@@ -38,7 +39,7 @@ class RecordDataFormatterFactory
      */
     public function __invoke()
     {
-        $helper = new RecordDataFormatter();
+        $helper = parent::__invoke();
 
         $helper->setDefaults('fid-acquisition-general', [$this, 'getFidAcquisitionSpecs']);
         $helper->setDefaults('fid-acquisition-subito-partial-copy', [$this, 'getFidAcquisitionSubitoPartialCopySpecs']);
@@ -54,7 +55,7 @@ class RecordDataFormatterFactory
     public function getFidAcquisitionSpecBuilder()
     {
         $spec = new SpecBuilder();
-        $spec->setLine('Title','getTitle');
+        $spec->setLine('Title', 'getTitle');
         $spec->setTemplateLine(
             'Authors/Corporations',
             'getDeduplicatedAuthors',
@@ -78,7 +79,7 @@ class RecordDataFormatterFactory
             'getPrice',
             'data-price.phtml'
         );
-        $spec->setLine('Language','getLanguages');
+        $spec->setLine('Language', 'getLanguages');
         return $spec;
     }
 
@@ -101,7 +102,7 @@ class RecordDataFormatterFactory
     public function getFidAcquisitionSubitoPartialCopySpecs()
     {
         $spec = $this->getFidAcquisitionSpecBuilder();
-        $spec->setLine('fid::number_of_pages','getNumberOfPages');
+        $spec->setLine('fid::number_of_pages', 'getNumberOfPages');
         return $spec->getArray();
     }
 }
-- 
GitLab